Bug 21749 – Misleading error message for an operator in an 'alias this'ed type

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-03-23T09:56:21Z
Last change time
2024-12-13T19:15:22Z
Assigned to
No Owner
Creator
Max Samukha
Moved to GitHub: dmd#18027 →

Comments

Comment #0 by maxsamukha — 2021-03-23T09:56:21Z
struct S { void opUnary(string op: "++")() { bad; } } struct S2 { S s; alias s this; } void main() { S2 s; ++s; } Error: s is not a scalar, it is a S2 The error should be similar to that when the operator is called explicitly: void main() { S2 s; s.opUnary!"++"(); } onlineapp.d(4): Error: undefined identifier bad onlineapp.d(15): Error: template instance onlineapp.S.opUnary!"++" error instantiating
Comment #1 by robert.schadek — 2024-12-13T19:15:22Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18027 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB