On 5 Apr 2014 13:45, "Johannes Pfau" <nos...@example.com> wrote: > > Am Sat, 5 Apr 2014 07:37:00 +0100 > schrieb Iain Buclaw <ibuc...@gdcproject.org>: > > > > Reason for no inline is "mismatched arguments" - which means that the > > caller and callee disagree on the arguments to pass to the function. > > The fix is to make sure that caller and callee arguments match when > > generating the function on both sides. We could prevent this from > > recurring by putting in an assert in the codegen. > > Root cause is that const(char)[] is a distinct type compared to char[] > so I think we need to make const(char)[] a variant of char[]. > > We could use build_variant_type_copy and then modify the copy > to use the correct basetype. Here's a proof of concept, could you finish > this Iain? > > (We should probably check all types which have a 'next' type if a > similar change makes sense for these) >
I've had another thought for a while now that involves not constifying 'in' parameters, but at the same time not loosing its guarantee.