Skip to content

Commit

Permalink
expands aliases inside recursive types, fixes bug referenced by pull …
Browse files Browse the repository at this point in the history
…request #56
  • Loading branch information
mascarenhas committed Mar 9, 2016
1 parent 3df4063 commit 3688ce6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
File renamed without changes.
15 changes: 15 additions & 0 deletions examples/issues/pr56.tl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
interface ELEM
x: integer
end

interface OBJ
parent: OBJ?
atr: ELEM -- if I change ELEM to {"x":integer}, I no longer get an error
end

local function f(o:OBJ)
local parent = o.parent
if parent then
f({atr={x=2}}) -- isn't this structurally equivalent to OBJ?
end
end
12 changes: 0 additions & 12 deletions examples/issues/tlc.lua

This file was deleted.

1 change: 1 addition & 0 deletions typedlua/tlchecker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ local function replace_names (env, t, pos, ignore)
local r = tltype.Recursive(t[1], replace_names(env, t[2], pos, ignore))
r.name = t.name
ignore[t[1]] = link
return r
elseif tltype.isLiteral(t) or
tltype.isBase(t) or
tltype.isNil(t) or
Expand Down

0 comments on commit 3688ce6

Please sign in to comment.