fixes #3305; error message will improve with later improvements for concepts

This commit is contained in:
Araq
2015-09-18 01:50:28 +02:00
parent 36f68e1650
commit 1c0b815282

View File

@@ -511,6 +511,9 @@ proc typeRangeRel(f, a: PType): TTypeRelation {.noinline.} =
proc matchUserTypeClass*(c: PContext, m: var TCandidate,
ff, a: PType): TTypeRelation =
var body = ff.skipTypes({tyUserTypeClassInst})
if c.inTypeClass > 20:
localError(body.n[3].info, $body.n[3] & " too nested for type matching")
return isNone
openScope(c)
inc c.inTypeClass