www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12561] New: typeof function literal doesn't check safe

https://issues.dlang.org/show_bug.cgi?id=12561

          Issue ID: 12561
           Summary: typeof function literal doesn't check  safe
           Product: D
           Version: unspecified
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

cat > bug.d << CODE
struct Sunsafe { this(this)  system pure nothrow {} }
pragma(msg, typeof(()  safe { Sunsafe a = Sunsafe.init, b = a; }));
CODE

dmd -c bug.d
----
void function() pure nothrow  safe
----

As semantic of the function fails the type should be _error_.

--
Apr 11 2014