4110 – Function template with two constraints

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4110 - Function template with two constraints
Summary: Function template with two constraints
Status: RESOLVED DUPLICATE of issue 4084
Alias: None
Product: D
Classification: Unclassified
Component: tools (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
Reported: 2010年04月21日 13:53 UTC by bearophile_hugs
Modified: 2015年06月09日 05:13 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2010年04月21日 13:53:21 UTC
This D2 code is wrong:
void foo(T)(T x)
 if (is(T == int)) {
 if (!is(T == float)) {
}
void main() {
 foo(1);
}
The dmd 2.043 compiler+linker spit out:
OPTLINK (R) for Win32 Release 8.00.2
Copyright (C) Digital Mars 1989-2009 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Warning 23: No Stack 
OPTLINK : Warning 134: No Start Address
Comment 1 Gide Nwawudu 2010年04月24日 02:41:46 UTC
You missed out a brace, patch in BUG 4084 should prevent this from compiling.
*** This issue has been marked as a duplicate of issue 4084 ***


AltStyle によって変換されたページ (->オリジナル) /