www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8547] New: Pure Functions Compilation - Not consistent errors

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8547

           Summary: Pure Functions Compilation - Not consistent errors
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: daniel350 bigpond.com


--- Comment #0 from Daniel Cousens <daniel350 bigpond.com> 2012-08-15 04:50:45
PDT ---
module vector;

struct vec2(T) {
      T x, y;

      this(T x, T y) { this.x = x; this.y = y; }
      auto opDispatch(string swiz)() pure const {
            writeln(swiz);
            return 2;
      }
}

alias vec2!int vec2i;

import std.stdio;

void main() {
//    auto x = new vec2i(1, 2); // error about writeln (inpure function) in
pure function
      auto x = vec2i(1, 2); // no error, just fails to compile

      writeln(x.xy);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 15 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8547



--- Comment #1 from Daniel Cousens <daniel350 bigpond.com> 2012-08-15 04:55:41
PDT ---
To be clear, an error was expected for both, not just one.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 15 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8547


Daniel Cousens <daniel350 bigpond.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #2 from Daniel Cousens <daniel350 bigpond.com> 2012-09-22 03:24:53
PDT ---
*** This issue has been marked as a duplicate of issue 8387 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 22 2012