mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-16 06:45:44 +08:00
7f867ac166
Adds number support to the prototype. Binary operators are next.
20 lines
349 B
Plaintext
20 lines
349 B
Plaintext
local function id(x)
|
|
return x
|
|
end
|
|
local function comp(f)
|
|
return function(g)
|
|
return function(x)
|
|
return f(g(x))
|
|
end
|
|
end
|
|
end
|
|
local id2 = comp(id)(id)
|
|
local nil2 = id2(nil)
|
|
local a : any = nil
|
|
local b : nil = nil
|
|
local c : (nil) -> nil = nil
|
|
local d : (any & nil) = nil
|
|
local e : any? = nil
|
|
local f : number = 123.0
|
|
return id2(nil2)
|