diff options
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/msgs.nim | 5 | ||||
-rwxr-xr-x | compiler/semtypes.nim | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/compiler/msgs.nim b/compiler/msgs.nim index da2e682e8..ac884538d 100755 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -547,10 +547,11 @@ type proc handleError(msg: TMsgKind, eh: TErrorHandling) = if msg == errInternal: assert(false) # we want a stack trace here - if (msg >= fatalMin) and (msg <= fatalMax): + if msg >= fatalMin and msg <= fatalMax: if gVerbosity >= 3: assert(false) quit(1) - if (msg >= errMin) and (msg <= errMax): + if msg >= errMin and msg <= errMax: + if gVerbosity >= 3: assert(false) inc(gErrorCounter) options.gExitcode = 1'i8 if gErrorCounter >= gErrorMax or eh == doAbort: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 3d572f517..ff05586fa 100755 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -625,14 +625,18 @@ proc semGenericParamInInvokation(c: PContext, n: PNode): PType = result = semTypeNode(c, n, nil) proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = - if s.typ == nil or s.typ.kind != tyGenericBody: - GlobalError(n.info, errCannotInstantiateX, s.name.s) result = newOrPrevType(tyGenericInvokation, prev, c) - if s.typ.containerID == 0: InternalError(n.info, "semtypes.semGeneric") - if sonsLen(n) != sonsLen(s.typ): + var isConcrete = true + if s.typ == nil: + GlobalError(n.info, errCannotInstantiateX, s.name.s) + elif s.typ.kind != tyGenericBody: + isConcrete = false + elif s.typ.containerID == 0: + InternalError(n.info, "semtypes.semGeneric") + elif sonsLen(n) != sonsLen(s.typ): GlobalError(n.info, errWrongNumberOfArguments) addSon(result, s.typ) - var isConcrete = true # iterate over arguments: + # iterate over arguments: for i in countup(1, sonsLen(n)-1): var elem = semGenericParamInInvokation(c, n.sons[i]) if containsGenericType(elem): isConcrete = false |