test(lua/type_inferer): add missing tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
f586e58ac3
commit
8a13df3ce1
1 changed files with 12 additions and 0 deletions
12
tests/lua/ty2.lua
Normal file
12
tests/lua/ty2.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
local env = environment()
|
||||
local inferer = type_inferer(env)
|
||||
env:add_var("N", Type())
|
||||
local N = Const("N")
|
||||
env:add_var("a", N)
|
||||
local ctx = context()
|
||||
ctx = extend(ctx, "x", N)
|
||||
assert(inferer(Var(0), ctx) == N)
|
||||
assert(not pcall(function() inferer(Var(1), ctx) end))
|
||||
inferer:clear()
|
||||
assert(inferer(Var(0), ctx) == N)
|
||||
assert(is_type_inferer(inferer))
|
Loading…
Reference in a new issue