restore compilation and make all concepts tests green

This commit is contained in:
Zahary Karadjov 2017-01-27 01:17:34 +02:00
commit c605d57574
4 changed files with 42 additions and 41 deletions

View file

@ -790,7 +790,8 @@ proc getTypeDescAux(m: BModule, origTyp: PType, check: var IntSet): Rope =
of 1, 2, 4, 8: addf(m.s[cfsTypes], "typedef NU$2 $1;$n", [result, rope(s*8)])
else: addf(m.s[cfsTypes], "typedef NU8 $1[$2];$n",
[result, rope(getSize(t))])
of tyGenericInst, tyDistinct, tyOrdinal, tyTypeDesc, tyAlias:
of tyGenericInst, tyDistinct, tyOrdinal, tyTypeDesc, tyAlias,
tyUserTypeClass, tyUserTypeClassInst, tyInferred:
result = getTypeDescAux(m, lastSon(t), check)
else:
internalError("getTypeDescAux(" & $t.kind & ')')

View file

@ -72,8 +72,8 @@ type # please make sure we have under 32 options
TGlobalOptions* = set[TGlobalOption]
const
harmlessOptions* = {optForceFullMake, optNoLinking, optReportConceptFailures,
optRun, optUseColors, optStdout}
harmlessOptions* = {optForceFullMake, optNoLinking, optRun,
optUseColors, optStdout}
type
TCommands* = enum # Nim's commands

View file

@ -701,7 +701,7 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate,
# We need to put them in the current sigmatch's binding table in order for them
# to be resolvable while matching the rest of the parameters
for p in typeParams:
put(m.bindings, p[1], p[0].typ)
put(m, p[1], p[0].typ)
if ff.kind == tyUserTypeClassInst:
result = generateTypeInstance(c, m.bindings, Concept.sym.info, ff)
@ -831,7 +831,7 @@ proc inferStaticsInRange(c: var TCandidate,
var rhs = r
var inferred = inferStaticParam(exp, rhs)
if inferred != nil:
put(c.bindings, inferred, inferred)
put(c, inferred, inferred)
return isGeneric
else:
failureToInferStaticParam exp
@ -1612,8 +1612,8 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
if a.kind == tyStatic:
if m.callee.kind == tyGenericBody and
argType.n == nil and
tfGenericTypeParam notin argType.flags:
a.n == nil and
tfGenericTypeParam notin a.flags:
return newNodeIT(nkType, argOrig.info, makeTypeFromExpr(c, arg))
else:
var evaluated = c.semTryConstExpr(c, arg)