Bug 22824 – alias template parameter bound to wrong symbol (Error: template instance does not match template declaration)

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-02-25T23:52:57Z
Last change time
2024-12-13T19:21:13Z
Assigned to
No Owner
Creator
kdevel
Moved to GitHub: dmd#20061 →

Comments

Comment #0 by kdevel — 2022-02-25T23:52:57Z
```model.d module model; // model.d import std.file : read; // this line provokes the error int read (string filename) { import std.file; auto data = std.file.read (filename); return 0; } ``` ```main.d module main; // main.d import std.traits; import model; void main () { alias Q = Parameters!(read); } ``` $ dmd -i main main.d(7): Error: template instance `model.Parameters!(read)` does not match template declaration `Parameters(func...)` with `func = (read)` must satisfy the following constraint: ` isCallable!func` As explained in [1] the template parameter is bound to std.file.read instead of module.read. [1] http://forum.dlang.org/thread/[email protected] template instance does not match template declaration
Comment #1 by robert.schadek — 2024-12-13T19:21:13Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20061 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB