Bug 6794 – ICE(expression.c): with inout

Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-10-08T19:09:00Z
Last change time
2013-01-16T07:01:32Z
Keywords
ice
Assigned to
nobody
Creator
bearophile_hugs

Comments

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'
Comment #1 by lovelydear — 2012-04-20T16:43:30Z
Compiles and runs fine on 2.059 Win32
Comment #2 by yebblies — 2013-01-16T07:01:32Z
No crash for me with 2.062 head on win32.