dmd/compiler/test/fail_compilation/b17285.d
Dennis 28bc5c6e74
Fix #20763 - Inconsistent handling of type + value in typeof expressions (#20798)
* Fix #20763 - Inconsistent handling of type + value in typeof expressions

* Add supplemental error

---------

Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2025-01-29 11:26:01 +01:00

16 lines
398 B
D

/*
TEST_OUTPUT:
---
fail_compilation/b17285.d(15): Error: type `ONE` has no value
fail_compilation/b17285.d(15): perhaps use `ONE.init`
fail_compilation/b17285.d(15): Error: type `TWO` has no value
fail_compilation/b17285.d(15): Error: cannot implicitly convert expression `ONE` of type `b17285.ONE` to `int`
---
*/
class ONE {}
enum TWO;
void foo() {
foreach(key; [ONE, TWO, 1]) {}
}