-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13792 from dwijnand/lint-too-big-constants-pr
- Loading branch information
Showing
5 changed files
with
62 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
-- [E167] Lossy Conversion Error: tests/neg-custom-args/fatal-warnings/i11333.scala:2:19 ------------------------------- | ||
2 | val f1: Float = 123456789 // error | ||
| ^^^^^^^^^ | ||
| Widening conversion from Int to Float loses precision. | ||
| Write `.toFloat` instead. | ||
-- [E167] Lossy Conversion Error: tests/neg-custom-args/fatal-warnings/i11333.scala:3:19 ------------------------------- | ||
3 | val d1: Double = 1234567890123456789L // error | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| Widening conversion from Long to Double loses precision. | ||
| Write `.toDouble` instead. | ||
-- [E167] Lossy Conversion Error: tests/neg-custom-args/fatal-warnings/i11333.scala:4:19 ------------------------------- | ||
4 | val f2: Float = 123456789L // error | ||
| ^^^^^^^^^^ | ||
| Widening conversion from Long to Float loses precision. | ||
| Write `.toFloat` instead. | ||
-- [E167] Lossy Conversion Error: tests/neg-custom-args/fatal-warnings/i11333.scala:10:21 ------------------------------ | ||
10 | val f1_b: Float = i1 // error | ||
| ^^ | ||
| Widening conversion from Int to Float loses precision. | ||
| Write `.toFloat` instead. | ||
-- [E167] Lossy Conversion Error: tests/neg-custom-args/fatal-warnings/i11333.scala:11:21 ------------------------------ | ||
11 | val d1_b: Double = l1 // error | ||
| ^^ | ||
| Widening conversion from Long to Double loses precision. | ||
| Write `.toDouble` instead. | ||
-- [E167] Lossy Conversion Error: tests/neg-custom-args/fatal-warnings/i11333.scala:12:21 ------------------------------ | ||
12 | val f2_b: Float = l2 // error | ||
| ^^ | ||
| Widening conversion from Long to Float loses precision. | ||
| Write `.toFloat` instead. |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class C: | ||
val f1: Float = 123456789 // error | ||
val d1: Double = 1234567890123456789L // error | ||
val f2: Float = 123456789L // error | ||
|
||
inline val i1 = 123456789 | ||
inline val l1 = 1234567890123456789L | ||
inline val l2 = 123456789L | ||
|
||
val f1_b: Float = i1 // error | ||
val d1_b: Double = l1 // error | ||
val f2_b: Float = l2 // error |