dmd/compiler/test/fail_compilation/lexer5.d
Max Haughton 1b78c63393
Fix Issue 23284 - better floating point error messages. (#14354)
* Fix Issue 23284 - better floating point error messages.

There was also a bug here in that real literals did not get a suffix attached.

* Replace an array lookup with a ternary, more tests
2022-08-31 13:33:25 +03:00

12 lines
481 B
D

/*
TEST_OUTPUT:
---
fail_compilation/lexer5.d(11): Error: number `1e-100f` is not representable as a `float`
fail_compilation/lexer5.d(11): https://dlang.org/spec/lex.html#floatliteral
fail_compilation/lexer5.d(12): Error: number `1e-10024` is not representable as a `double`
fail_compilation/lexer5.d(12): `real` literals can be written using the `L` suffix. https://dlang.org/spec/lex.html#floatliteral
---
*/
static float f = 1e-100f;
static float f2 = 1e-10024;