fixes #7092
This commit is contained in:
parent
7ac1e6e528
commit
bf85955802
2 changed files with 13 additions and 3 deletions
|
|
@ -59,7 +59,7 @@ proc genLiteral(p: BProc, n: PNode, ty: PType): Rope =
|
||||||
else:
|
else:
|
||||||
result = rope("NIM_NIL")
|
result = rope("NIM_NIL")
|
||||||
of nkStrLit..nkTripleStrLit:
|
of nkStrLit..nkTripleStrLit:
|
||||||
case skipTypes(ty, abstractVarRange + {tyStatic}).kind
|
case skipTypes(ty, abstractVarRange + {tyStatic, tyUserTypeClass, tyUserTypeClassInst}).kind
|
||||||
of tyNil:
|
of tyNil:
|
||||||
result = genNilStringLiteral(p.module, n.info)
|
result = genNilStringLiteral(p.module, n.info)
|
||||||
of tyString:
|
of tyString:
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ Sortable
|
||||||
Container
|
Container
|
||||||
TObj
|
TObj
|
||||||
int
|
int
|
||||||
|
111 111
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -25,7 +26,7 @@ type
|
||||||
C.len is Ordinal
|
C.len is Ordinal
|
||||||
for v in items(C):
|
for v in items(C):
|
||||||
v.type is tuple|object
|
v.type is tuple|object
|
||||||
|
|
||||||
proc foo(c: ObjectContainer) =
|
proc foo(c: ObjectContainer) =
|
||||||
echo "Container"
|
echo "Container"
|
||||||
|
|
||||||
|
|
@ -94,6 +95,15 @@ proc to(x: TObj, t: type JSonValue) = discard
|
||||||
proc testFoo(x: TFoo) =
|
proc testFoo(x: TFoo) =
|
||||||
echo x.TypeName
|
echo x.TypeName
|
||||||
echo x.MappedType.name
|
echo x.MappedType.name
|
||||||
|
|
||||||
testFoo(TObj(x: 10))
|
testFoo(TObj(x: 10))
|
||||||
|
|
||||||
|
# bug #7092
|
||||||
|
|
||||||
|
type stringTest = concept x
|
||||||
|
x is string
|
||||||
|
|
||||||
|
let usedToFail: stringTest = "111"
|
||||||
|
let working: string = "111"
|
||||||
|
|
||||||
|
echo usedToFail, " ", working
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue