diff options
-rw-r--r-- | compiler/semstmts.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index d42eb5433..12391a9cd 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -500,6 +500,8 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode = #changeType(def.skipConv, typ, check=true) else: typ = skipIntLit(def.typ) + if typ.kind in tyUserTypeClasses and typ.isResolvedUserTypeClass: + typ = typ.lastSon if hasEmpty(typ): localError(def.info, errCannotInferTypeOfTheLiteral, ($typ.kind).substr(2).toLowerAscii) |