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

--- Comment #0 from David Simcha <> 2012-01-15 08:26:34 PST ---
import std.exception;

struct RefCounted(T) {
    T payload;

    T refCountedPayload() { return payload;}
    alias refCountedPayload this;

void main() {
    RefCounted!int x;

void doPure(ref RefCounted!int lhs) pure {
    std.exception.pointsTo(lhs, lhs);

test.d(16): Error: pure function 'doPure' cannot call impure function

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:
------- You are receiving this mail because: -------

Reply via email to