D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 12605 - Calculate proper common type of lambdas
Summary: Calculate proper common type of lambdas
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-21 04:08 UTC by Kenji Hara
Modified: 2024-12-13 18:19 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2014-04-21 04:08:24 UTC
Currently this code:

pragma(msg, typeof(true ? (x => x) : ((int x) => x * 2)));

prints 'void'. But it could print 'int function(int)' by fitting parameter types.

More cases:

pragma(msg, typeof(true ? (()=>1) : (()=>1.0)));
// fitting return types - could be 'double function()'

pragma(msg, typeof(true ? ((int x) => 1) : (delegate(int x)=>1)));
// fitting context type --> could be 'int delegate(int)'
Comment 1 dlangBugzillaToGithub 2024-12-13 18:19:52 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17653

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB