This commit is contained in:
Araq 2018-10-02 23:45:27 +02:00
commit bf85955802
2 changed files with 13 additions and 3 deletions

View file

@ -59,7 +59,7 @@ proc genLiteral(p: BProc, n: PNode, ty: PType): Rope =
else:
result = rope("NIM_NIL")
of nkStrLit..nkTripleStrLit:
case skipTypes(ty, abstractVarRange + {tyStatic}).kind
case skipTypes(ty, abstractVarRange + {tyStatic, tyUserTypeClass, tyUserTypeClassInst}).kind
of tyNil:
result = genNilStringLiteral(p.module, n.info)
of tyString:

View file

@ -4,6 +4,7 @@ Sortable
Container
TObj
int
111 111
'''
"""
@ -97,3 +98,12 @@ proc testFoo(x: TFoo) =
testFoo(TObj(x: 10))
# bug #7092
type stringTest = concept x
x is string
let usedToFail: stringTest = "111"
let working: string = "111"
echo usedToFail, " ", working