Bug 10102 – @disable incompletely implemented

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-16T23:23:00Z
Last change time
2013-05-18T17:17:52Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
bugzilla

Comments

Comment #0 by bugzilla — 2013-05-16T23:23:37Z
Many things are not checked for: -------------------------- struct NotNull(T) { T p; alias p this; this(T p) { assert(p != null, "pointer is null"); this.p = p; } @disable this(); NotNull opAssign(T p) { assert(p != null, "assigning null to NotNull"); this.p = p; return this; } } struct S { NotNull!(int *) m; // should fail: an explicit constructor must be required for S } void main() { int i; NotNull!(int*) n = &i; *n = 3; assert(i == 3); n = &i; n += 1; NotNull!(int*)[3] a; // should fail auto b = new NotNull!(int*)[3]; // should fail S s = S(); // should fail }
Comment #1 by k.hara.pg — 2013-05-18T00:37:56Z
Comment #2 by github-bugzilla — 2013-05-18T11:54:06Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/128cdb7bdb75b94d606efbd6d0a9efca68d0b941 fix Issue 10102 - @disable incompletely implemented https://github.com/D-Programming-Language/dmd/commit/0c912dae6b482070ae03979a4c7ad0d4b57830a6 Merge pull request #2050 from 9rnsr/fix10102 Issue 10102 - @disable incompletely implemented
Comment #3 by github-bugzilla — 2013-05-18T17:17:52Z
Commit pushed to 2.063 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d9b0fc503ef26ad5f287ff51d7ca770a405a6916 Merge pull request #2050 from 9rnsr/fix10102 Issue 10102 - @disable incompletely implemented