Bug 21551 – string literal followed by address expression pass the parsing phase

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-01-15T11:09:22Z
Last change time
2021-01-15T11:28:50Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Basile-z

Comments

Comment #0 by b2.temp — 2021-01-15T11:09:22Z
this seems to be accepted by the parser and is rejected during semantic --- module runnable; void stuff(string){} void main() { "a" &stuff; } --- with > /tmp/temp_7F751D15BED0.d:7:10: Error: function `runnable.stuff(string _param_0)` is not callable using argument types `()`
Comment #1 by b2.temp — 2021-01-15T11:16:10Z
maybe the parser thinks this is an implicit string concatenation between a literal and an entity ? But even in this case there should be a deprecation message at least.
Comment #2 by default_357-line — 2021-01-15T11:23:56Z
It's a bit and expression. "a" & stuff().
Comment #3 by b2.temp — 2021-01-15T11:28:50Z
this is a binary &...