Bug 14190 – Overload sets example incorrect

Status
NEW
Severity
normal
Priority
P3
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-02-16T17:14:16Z
Last change time
2024-12-15T15:22:47Z
Keywords
spec
Assigned to
No Owner
Creator
Vladimir Panteleev
Moved to GitHub: dlang.org#4038 →

Comments

Comment #0 by dlang-bugzilla — 2015-02-16T17:14:16Z
http://dlang.org/function.html#overload-sets specifies the following example: /////////////////////////// A.d ////////////////////////// module A; void foo() { } void foo(long i) { } /////////////////////////// B.d ////////////////////////// module B; class C { } void foo(C) { } void foo(int i) { } ///////////////////////// test.d ///////////////////////// import A; import B; void bar(C c) { foo(); // calls A.foo() foo(1L); // calls A.foo(long) foo(c); // calls B.foo(C) foo(1,2); // error, does not match any foo foo(1); // error, matches A.foo(long) and B.foo(int) A.foo(1); // calls A.foo(long) } ////////////////////////////////////////////////////////// However, the line: foo(1L); // calls A.foo(long) doesn't actually work: test.d(7): Error: B.foo at B.d(4) conflicts with A.foo at A.d(3)
Comment #1 by robert.schadek — 2024-12-15T15:22:47Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/4038 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB