Bug 24791 – pragma(msg, BasicType TypeSuffix) doesn't parse

Status
NEW
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2024-10-04T04:50:09Z
Last change time
2024-12-13T19:37:45Z
Assigned to
No Owner
Creator
Manu
Moved to GitHub: dmd#18271 →

Comments

Comment #0 by turkeyman — 2024-10-04T04:50:09Z
I feel like this should work: int x; pragma(msg, typeof(x)*); error : expression expected, not `)` It should print `int*`
Comment #1 by nick — 2024-10-05T16:55:34Z
The argument must be an AssignExpression. https://dlang.org/spec/pragma.html#msg There is no postfix `*` operator, so it fails to parse.
Comment #2 by turkeyman — 2024-10-11T08:53:27Z
I don't really care for reasons; this is an obvious bug: pragma(msg, int); // > int pragma(msg, int*); // > int* alias X = int; pragma(msg, X); // > int pragma(msg, X*); // error! Edge cases like this just randomly break meta-programming. We especially depend on pragma(msg) to understand and debug meta-programming.
Comment #3 by robert.schadek — 2024-12-13T19:37:45Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18271 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB