Bug 18583 – Wrong symbol in error message

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2018-03-09T12:13:53Z
Last change time
2024-12-13T18:57:43Z
Assigned to
No Owner
Creator
Simen Kjaeraas
Moved to GitHub: dmd#17849 →

Comments

Comment #0 by simen.kjaras — 2018-03-09T12:13:53Z
struct S { int n; enum t = tmp!(a => n); } string tmp(alias T)() { return ""; } foo.d(6): Error: function foo.S.tmp!((a) => n).tmp need 'this' to access member tmp foo.d(3): called from here: tmp() Notice that the error message claims tmp needs 'this' to access itself. Surely the latter should say 'member n' instead.
Comment #1 by simen.kjaras — 2018-03-09T12:39:39Z
Further simplified: struct S { int n; enum t = tmp!n; } string tmp(alias T)() { return ""; } It seems tmp has to be a function template - reducing it to `enum tmp(alias T) = 1;` removes the error message.
Comment #2 by robert.schadek — 2024-12-13T18:57:43Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17849 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB