mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00

* Fix #20763 - Inconsistent handling of type + value in typeof expressions * Add supplemental error --------- Co-authored-by: Dennis Korpel <dennis@sarc.nl>
16 lines
398 B
D
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]) {}
|
|
}
|