-
-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Single div without cast to Float (#12039)
* [hl] Allow F32 div without cast to Float * unsigned_op is not needed in f32 div * Use Single in div result type when e1 and e2 are both Single * Only do is_single check if OpDiv * [tests] add Single type test and fix a out path * [tests] do not use -fail in hxml(.stderr)
- Loading branch information
Showing
5 changed files
with
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
-m Issue11196 | ||
-hl out.hl | ||
-hl out/main.hl | ||
-dce no |
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,17 @@ | ||
class Main { | ||
static function main() { | ||
var s1 : Single = 10.0; | ||
var s2 : Single = 0.3; | ||
var f1 : Float = 10.0; | ||
var f2 : Float = 0.3; | ||
$type(s1 + s2); | ||
$type(s1 - s2); | ||
$type(s1 * s2); | ||
$type(s1 / s2); | ||
$type(s1 / (f2 : Single)); | ||
$type((f1 : Single) / s2); | ||
$type((f1 : Single) / (f2 : Single)); | ||
$type(f1 / s2); | ||
$type(s1 / f2); | ||
} | ||
} |
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,2 @@ | ||
--main Main | ||
--hl out/main.hl |
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,9 @@ | ||
Main.hx:7: characters 9-16 : Warning : Single | ||
Main.hx:8: characters 9-16 : Warning : Single | ||
Main.hx:9: characters 9-16 : Warning : Single | ||
Main.hx:10: characters 9-16 : Warning : Single | ||
Main.hx:11: characters 9-27 : Warning : Single | ||
Main.hx:12: characters 9-27 : Warning : Single | ||
Main.hx:13: characters 9-38 : Warning : Single | ||
Main.hx:14: characters 9-16 : Warning : Float | ||
Main.hx:15: characters 9-16 : Warning : Float |