mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Changed my mind about oftype/typeof
This commit is contained in:
@@ -11,5 +11,5 @@ t = astype [float]; //redefnition
|
||||
|
||||
var b: u;
|
||||
|
||||
print oftype a; //<[<int>]>
|
||||
print oftype b; //<[<float>]>
|
||||
print typeof a; //<[<int>]>
|
||||
print typeof b; //<[<float>]>
|
||||
@@ -32,7 +32,7 @@
|
||||
assert func() == 69, "import/export of functions failed";
|
||||
}
|
||||
|
||||
//test that variables retain their types with the oftype keyword
|
||||
//test that variables retain their types with the typeof keyword
|
||||
{
|
||||
var t: type = int;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
{
|
||||
import t;
|
||||
|
||||
assert oftype t == type, "type retention failed";
|
||||
assert typeof t == type, "type retention failed";
|
||||
}
|
||||
|
||||
print "All good";
|
||||
|
||||
Reference in New Issue
Block a user