Bug 1982 – [CTFE] Problems with compile-time null

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-04-10T02:00:00Z
Last change time
2015-06-09T01:14:37Z
Keywords
CTFE, rejects-valid
Assigned to
nobody
Creator
samukha
Depends on
7988
Blocks
4738

Comments

Comment #0 by samukha — 2008-04-10T02:00:19Z
More test cases that should pass: ---- enum a = [1, 2, 3]; static assert (a !is null); string foo() { return null; } static assert (foo() is null); static assert (!foo().length); static assert (null is null); ---- Neither of the assert expressions can be evaluated at compile time.
Comment #1 by k.hara.pg — 2012-05-30T17:33:56Z
Marked as CTFE issue.
Comment #2 by github-bugzilla — 2013-07-12T14:07:00Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/64ea3d8a7223f6c9b1d00e167a5ced4bf20e7992 Fix bug 1982 [CTFE] Problems with compile-time null Test case only. This was fixed by doing const-folding in CTFE. https://github.com/D-Programming-Language/dmd/commit/a0ba3b2aa31d93709a1ed3e21f5a2deca6c761fc Merge pull request #2339 from donc/fourCTFEtestcases Test cases for bugs 1982, 7988, 8253, and 8285.