compilation cache: various bugfixes; works for the compiler itself

This commit is contained in:
Araq 2011-10-27 00:41:42 +02:00
commit 90db9171a2
13 changed files with 307 additions and 148 deletions

View file

@ -128,8 +128,7 @@ proc checkConvertible(info: TLineInfo, castDest, src: PType) =
# we use d, s here to speed up that operation a bit:
case cmpTypes(d, s)
of isNone, isGeneric:
if not equalOrDistinctOf(castDest, src) and
not equalOrDistinctOf(src, castDest):
if not compareTypes(castDest, src, dcEqIgnoreDistinct):
GlobalError(info, errGenerated, `%`(
MsgKindToString(errIllegalConvFromXtoY),
[typeToString(src), typeToString(castDest)]))
@ -381,8 +380,7 @@ proc isAssignable(c: PContext, n: PNode): TAssignableResult =
# Object and tuple conversions are still addressable, so we skip them
if skipTypes(n.typ, abstractPtrs).kind in {tyOpenArray, tyTuple, tyObject}:
result = isAssignable(c, n.sons[1])
elif equalOrDistinctOf(n.typ, n.sons[1].typ) or
equalOrDistinctOf(n.sons[1].typ, n.typ):
elif compareTypes(n.typ, n.sons[1].typ, dcEqIgnoreDistinct):
# types that are equal modulo distinction preserve l-value:
result = isAssignable(c, n.sons[1])
of nkHiddenDeref, nkDerefExpr: