Bug 7941 – Regression(2.059): Type check is ignored when manifest constant initializer is function literal

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-18T21:34:00Z
Last change time
2012-05-01T23:12:59Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
kekeniro2

Comments

Comment #0 by kekeniro2 — 2012-04-18T21:34:36Z
DMD should not compile this, but DMD2.059 does. enum int c = function(){ }; DMD2.058 or earlier: Error: cannot implicitly convert expression (__funcliteral1) of type void function() pure nothrow @safe to int
Comment #1 by k.hara.pg — 2012-05-01T09:03:00Z
Comment #2 by github-bugzilla — 2012-05-01T22:20:58Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f3d112d16dc2b04b119b0b0d5f54a030944b10e5 fix Issue 7941 - Regression(2.059): Type check is ignored when manifest constant initializer is function literal https://github.com/D-Programming-Language/dmd/commit/2cf7e9ca9a2adda375952949fc2738362392139a Merge pull request #918 from 9rnsr/fix7941 Issue 7941 - Regression(2.059): Type check is ignored when manifest constant initializer is function literal