D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21551 - string literal followed by address expression pass the parsing phase
Summary: string literal followed by address expression pass the parsing phase
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2021-01-15 11:09 UTC by basile-z
Modified: 2021-01-15 11:28 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description basile-z 2021-01-15 11:09:22 UTC
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 basile-z 2021-01-15 11:16:10 UTC
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 FeepingCreature 2021-01-15 11:23:56 UTC
It's a bit and expression. "a" & stuff().
Comment 3 basile-z 2021-01-15 11:28:50 UTC
this is a binary &...