-
-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
2 changed files
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/lexer5.d(8): Error: number `1e-100f` is not representable | ||
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; |