Comment #0 by bearophile_hugs — 2011-10-08T19:09:21Z
This is wrong code:
struct Foo(T) {
void bar(T)(inout T x) {}
}
void main() {
Foo!int f;
f.bar(1);
}
With DMD 2.056head it crashes DMD that gives:
test.d(2): Error: inout on parameter means inout must be on return type as well (if from D1 code, replace with 'ref')
test.d(2): Error: variable test.Foo!(int).Foo.bar!(int).bar.x inout variables can only be declared inside inout functions
test.d(6): Error: template instance test.Foo!(int).Foo.bar!(int) error instantiating
Assertion failure: 'tret->hasWild()' on line 993 in file 'expression.c'