Bug 15010 – Base interface member is shadowed inside the derived interface member body (template overloading issue)

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-09-04T06:19:01Z
Last change time
2024-12-13T18:44:28Z
Assigned to
No Owner
Creator
Maksim Zholudev
Moved to GitHub: dmd#17721 →

Comments

Comment #0 by maximzms — 2015-09-04T06:19:01Z
DMD64 D Compiler v2.067.1 In the code below Parent.foo is somehow shadowed (but still accessible) inside Child.foo body. Note that Parent.foo is "imported" to Child by alias declaration and is included in Child.foo overload set. The same error occurs for both interfaces and classes. test.d: ---------------------------------------- interface Parent { static void foo(T)() {} static void foo(T : dchar)() { foo!int(); // OK } } interface Child : Parent { alias foo = Parent.foo; static void foo(T : char)() { Parent.foo!int(); // OK Child.foo!int(); // OK { alias foo = Parent.foo; foo!int(); } // OK { alias foo = Child.foo; foo!int(); } // OK foo!int(); // Error } } void main() { Child.foo!char(); } ---------------------------------------- `dmd test` output: ---------------------------------------- test.d(21): Error: template instance foo!int does not match template declaration foo(T : char)() test.d(27): Error: template instance test.Child.foo!char error instantiating ----------------------------------------
Comment #1 by robert.schadek — 2024-12-13T18:44:28Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17721 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB