Bug 23372 – 'null' matched against T[] and T* selects T[]

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-09-24T19:16:00Z
Last change time
2024-12-13T19:24:45Z
Assigned to
No Owner
Creator
Max Samukha
Moved to GitHub: dmd#20156 →

Comments

Comment #0 by maxsamukha — 2022-09-24T19:16:00Z
void baz(T)(T* a) { } void baz(T)(T[] a) { } void main() { baz(null); // baz(T)(T*) is instantiated } Compilation should fail with an ambiguity error.
Comment #1 by maxsamukha — 2022-09-24T19:19:00Z
(In reply to Max Samukha from comment #0) > // baz(T)(T*) is instantiated It should read "// baz(T)(T[]) is instantiated"
Comment #2 by robert.schadek — 2024-12-13T19:24:45Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20156 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB