Variable Types
var test: Number | String = 50
print(test)
test = "string"
print(test)
test = false # should error
print(test)
A script which defines a variable with a Number | String
type, which later errors because a boolean is assigned to it.
var test: Number | String = 50
print(test)
test = "string"
print(test)
test = false # should error
print(test)
A script which defines a variable with a Number | String
type, which later errors because a boolean is assigned to it.