better error handling for better idetools support

This commit is contained in:
Araq 2012-07-29 23:08:28 +02:00
commit b595fc8347
13 changed files with 378 additions and 268 deletions

View file

@ -119,7 +119,8 @@ proc ReplaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym =
proc lookupTypeVar(cl: TReplTypeVars, t: PType): PType =
result = PType(idTableGet(cl.typeMap, t))
if result == nil:
GlobalError(t.sym.info, errCannotInstantiateX, typeToString(t))
LocalError(t.sym.info, errCannotInstantiateX, typeToString(t))
result = errorType(cl.c)
elif result.kind == tyGenericParam:
InternalError(cl.info, "substitution with generic parameter")