completed expr/stmt unification
This commit is contained in:
parent
8e5d6834cc
commit
fa0a327dd6
10 changed files with 642 additions and 673 deletions
|
|
@ -68,8 +68,10 @@ proc commonType*(x, y: PType): PType =
|
|||
var a = skipTypes(x, {tyGenericInst})
|
||||
var b = skipTypes(y, {tyGenericInst})
|
||||
result = x
|
||||
if a.kind in {tyExpr, tyNil}: return y
|
||||
elif b.kind in {tyExpr, tyNil}: return x
|
||||
if a.kind in {tyExpr, tyNil}: result = y
|
||||
elif b.kind in {tyExpr, tyNil}: result = x
|
||||
elif a.kind == tyStmt: result = a
|
||||
elif b.kind == tyStmt: result = b
|
||||
elif b.kind in {tyArray, tyArrayConstr, tySet, tySequence} and
|
||||
a.kind == b.kind:
|
||||
# check for seq[empty] vs. seq[int]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue