← Back to index
|
Original Bugzilla link
Bug 14354 – SDC test0106.d compiles, but should not
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2015-03-28T16:34:00Z
Last change time
2015-06-09T05:15:05Z
Assigned to
nobody
Creator
shammah.chancellor
Comments
Comment #0
by shammah.chancellor — 2015-03-28T16:34:22Z
SDC errors: ``` > ../bin/sdc test0106.d int foo(int i) { return i; } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test0106.d:13: error: Already defined ``` while DMD incorrectly compiles the source and runs. ```test0106.d //T compiles:no //T has-passed:yes int main() { return foo(); } int foo() { return 3; } static if(foo() == 3) { int foo(int i) { return i; } } ```
Comment #1
by ketmar — 2015-03-28T17:33:27Z
but there is no error, as `foo()` and `foo(int)` are different functions with different signatures.
Comment #2
by shammah.chancellor — 2015-03-28T17:35:26Z
Thanks. Didn't notice that -- I was going through all the failure cases a bit quickly. Will file a bug against SDC.