Bug 2845 – Alias-to-local as template argument + delegate = Access Violation

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-04-17T01:08:00Z
Last change time
2015-06-09T01:18:03Z
Assigned to
nobody
Creator
kinaba

Comments

Comment #0 by kinaba — 2009-04-17T01:08:59Z
Here is the minimal code I can reproduce the problem on DMD 2.028 on Windows Vista: struct dep_t(alias a) { int memvar; void memfun() {} } dep_t!(a) dep(alias a)() { return dep_t!(a)(); } void dep_and_del(D)(D a, void delegate() b) { /*nothing*/ } void main() { int x = 0; dep_and_del( dep!(x), {} ); dep_and_del( dep!(x), {x=1;} ); // object.Error: Access Violation }
Comment #1 by malteskarupke — 2012-10-31T15:05:44Z
Works in DMD 2.060. It compiles and runs without issues.