digitalmars.D.bugs - [Issue 7295] New: Alias This + Pure + pointsTo = rejects-valid
- d-bugmail puremagic.com (35/35) Jan 15 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7295
- d-bugmail puremagic.com (7/7) Jan 15 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7295
- d-bugmail puremagic.com (29/29) Jan 25 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7295
- d-bugmail puremagic.com (12/12) Jan 26 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7295
http://d.puremagic.com/issues/show_bug.cgi?id=7295 Summary: Alias This + Pure + pointsTo = rejects-valid Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: critical Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: dsimcha yahoo.com import std.exception; struct RefCounted(T) { T payload; T refCountedPayload() { return payload;} alias refCountedPayload this; } void main() { RefCounted!int x; doPure(x); } void doPure(ref RefCounted!int lhs) pure { std.exception.pointsTo(lhs, lhs); } test.d(16): Error: pure function 'doPure' cannot call impure function 'refCountedPayload' Marking as critical because this breaks std.algorithm.swap for ref counted types, though there may be an easy workaround: refCountedPayload() should probably be pure. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 15 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7295 One thing I forgot to note: This bug appears cross-module only. If I copy and paste pointsTo() into test.d, the bug goes away. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 15 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7295 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugdbug yahoo.com.au Reduced test case: struct S { int member; property ref int refCountedPayload() { return member; } alias refCountedPayload this; } // If you remove this next line, it works. void foo(S)(immutable S t, int qq) pure { } void foo(S)(S s) pure { } void bar() pure { S b; foo!int(b); } ------------------- The bug is in template.c, deduceFunctionTemplateMatch(). If a parameter fails to match (the immutable S above), it tries alias this. The first is to run semantic on the alias this, which causes the error. Those error messages should be suppressed. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 25 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7295 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED 00:45:17 PST --- https://github.com/D-Programming-Language/dmd/commit/2357f7771b7a5bdd560c2e8e9656d4194e8388d9 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 26 2012