So here's some problems.
I use 'const ref' to pass structs to functions (note: because 'in ref' doesn't seem to work)
void test( const ref Thing x ) {} // this works fine. note, 'const ref' works fine here (in lieu of 'in ref')
struct Thing { }
Thing thing;
const ref Thing func() { return gThing; }
This syntax complains, but it's precisely the same expression I use to pass an argument in to a function, and it's fine there:
remedy\modules\hud.d(35):Error: function remedy.hud.func without 'this' cannot be const/immutable
const ref Thing function() blah = &func;
I need to take a pointer to this function, but It complains when I declare a 'function' of this type:
remedy\modules\hud.d(36):Error: variable remedy.hud.blah only parameters or foreach declarations can be ref (... what? it works for parameters?)
I try rearranging the syntax to make the first issue stop complaining:
ref const(Thing) func2() { return gThing; } // this seems to work now, but i don't like the inconsistency...
ref const(Thing) function() blah2 = &func;
Error: variable remedy.hud.blah2 only parameters or foreach declarations can be ref