Bug 12094 – typeof(null) should convert to reference types

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-06T22:21:00Z
Last change time
2014-02-11T03:31:08Z
Keywords
pull, rejects-valid
Assigned to
yebblies
Creator
yebblies

Comments

Comment #0 by yebblies — 2014-02-06T22:21:20Z
void main() { auto n = null; int *a; int[int] b; int[] c; auto u = true ? null : a; auto v = true ? null : b; auto w = true ? null : c; auto x = true ? n : a; // error auto y = true ? n : b; // error auto z = true ? n : c; // error a = n; b = n; // error c = n; }
Comment #1 by yebblies — 2014-02-06T22:33:35Z
Comment #2 by andrej.mitrovich — 2014-02-07T01:10:56Z
Comment #3 by github-bugzilla — 2014-02-09T03:29:40Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e3541eee380ec22be990441cf05ca47cbbfd728d Fix Issue 12094 - typeof(null) should convert to reference types
Comment #4 by bearophile_hugs — 2014-02-09T04:40:03Z
I suspect this request was already in bugzilla somewhere.
Comment #5 by yebblies — 2014-02-11T03:31:08Z
Most likely.