diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgcalls.nim | 2 | ||||
-rw-r--r-- | compiler/sigmatch.nim | 4 | ||||
-rw-r--r-- | compiler/types.nim | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim index 91dcaef42..aa998cde5 100644 --- a/compiler/ccgcalls.nim +++ b/compiler/ccgcalls.nim @@ -1,7 +1,7 @@ # # # The Nim Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2015 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 041420999..dd92ddba5 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -1537,7 +1537,9 @@ proc matchesAux(c: PContext, n, nOrig: PNode, copyTree(n.sons[a]), m, c)) else: addSon(m.call, copyTree(n.sons[a])) - elif formal != nil: + elif formal != nil and formal.typ.kind == tyVarargs: + # beware of the side-effects in 'prepareOperand'! So only do it for + # varags matching. See tests/metatype/tstatic_overloading. m.baseTypeMatch = false n.sons[a] = prepareOperand(c, formal.typ, n.sons[a]) var arg = paramTypesMatch(m, formal.typ, n.sons[a].typ, diff --git a/compiler/types.nim b/compiler/types.nim index 5f506f10f..0809e5b0e 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -919,6 +919,9 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = result = sameFlags(a, b) of tyStatic, tyFromExpr: result = exprStructuralEquivalent(a.n, b.n) and sameFlags(a, b) + if result and a.len == b.len and a.len == 1: + cycleCheck() + result = sameTypeAux(a.sons[0], b.sons[0], c) of tyObject: ifFastObjectTypeCheckFailed(a, b): cycleCheck() |