I'm trying to use Teal to have the concept of units, and while I can create my own new types based off of a number, however I'm allowed to still add those two different types together.
Here's an example:
local type Temperature = number
local type Day = number
local temp: Temperature = 45
local birthday: Day = 34
print(temp + birthday) -- doesn't report as an error or warning
I'm not exactly sure if this is a bug, but I feel like you should only be able to get away with this if you use as to have it be treated as a different type.
I'm trying to use Teal to have the concept of units, and while I can create my own new types based off of a
number, however I'm allowed to still add those two different types together.Here's an example:
I'm not exactly sure if this is a bug, but I feel like you should only be able to get away with this if you use
asto have it be treated as a different type.