D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7941 - Regression(2.059): Type check is ignored when manifest constant initializer is function literal
Summary: Regression(2.059): Type check is ignored when manifest constant initializer i...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 regression
Assignee: No Owner
URL:
Keywords: accepts-invalid, pull
Depends on:
Blocks:
 
Reported: 2012-04-18 21:34 UTC by kekeniro2
Modified: 2012-05-01 23:12 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description kekeniro2 2012-04-18 21:34:36 UTC
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 2 github-bugzilla 2012-05-01 22:20:58 UTC
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