mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Implemented #27, easy coercion from int to float
This commit is contained in:
13
scripts/test/coercions.toy
Normal file
13
scripts/test/coercions.toy
Normal file
@@ -0,0 +1,13 @@
|
||||
//test int -> float coercion
|
||||
{
|
||||
var f: float = 0;
|
||||
|
||||
assert typeof f == float, "coercion on decl failed";
|
||||
|
||||
f = 42;
|
||||
|
||||
assert typeof f == float, "coercion on assign failed";
|
||||
}
|
||||
|
||||
|
||||
print "All good";
|
||||
Reference in New Issue
Block a user