parent
6dba06f9e6
commit
0d8507cd3d
2 changed files with 19 additions and 3 deletions
|
|
@ -764,11 +764,11 @@ proc fillBody(c: var TLiftCtx; t: PType; body, x, y: PNode) =
|
||||||
of tyFromExpr, tyProxy, tyBuiltInTypeClass, tyUserTypeClass,
|
of tyFromExpr, tyProxy, tyBuiltInTypeClass, tyUserTypeClass,
|
||||||
tyUserTypeClassInst, tyCompositeTypeClass, tyAnd, tyOr, tyNot, tyAnything,
|
tyUserTypeClassInst, tyCompositeTypeClass, tyAnd, tyOr, tyNot, tyAnything,
|
||||||
tyGenericParam, tyGenericBody, tyNil, tyUntyped, tyTyped,
|
tyGenericParam, tyGenericBody, tyNil, tyUntyped, tyTyped,
|
||||||
tyTypeDesc, tyGenericInvocation, tyForward:
|
tyTypeDesc, tyGenericInvocation, tyForward, tyStatic:
|
||||||
#internalError(c.g.config, c.info, "assignment requested for type: " & typeToString(t))
|
#internalError(c.g.config, c.info, "assignment requested for type: " & typeToString(t))
|
||||||
discard
|
discard
|
||||||
of tyOrdinal, tyRange, tyInferred,
|
of tyOrdinal, tyRange, tyInferred,
|
||||||
tyGenericInst, tyStatic, tyAlias, tySink:
|
tyGenericInst, tyAlias, tySink:
|
||||||
fillBody(c, lastSon(t), body, x, y)
|
fillBody(c, lastSon(t), body, x, y)
|
||||||
|
|
||||||
proc produceSymDistinctType(g: ModuleGraph; c: PContext; typ: PType;
|
proc produceSymDistinctType(g: ModuleGraph; c: PContext; typ: PType;
|
||||||
|
|
@ -916,7 +916,7 @@ proc createTypeBoundOps(g: ModuleGraph; c: PContext; orig: PType; info: TLineInf
|
||||||
incl orig.flags, tfCheckedForDestructor
|
incl orig.flags, tfCheckedForDestructor
|
||||||
|
|
||||||
let skipped = orig.skipTypes({tyGenericInst, tyAlias, tySink})
|
let skipped = orig.skipTypes({tyGenericInst, tyAlias, tySink})
|
||||||
if isEmptyContainer(skipped): return
|
if isEmptyContainer(skipped) or skipped.kind == tyStatic: return
|
||||||
|
|
||||||
let h = sighashes.hashType(skipped, {CoType, CoConsiderOwned, CoDistinct})
|
let h = sighashes.hashType(skipped, {CoType, CoConsiderOwned, CoDistinct})
|
||||||
var canon = g.canonTypes.getOrDefault(h)
|
var canon = g.canonTypes.getOrDefault(h)
|
||||||
|
|
|
||||||
|
|
@ -89,3 +89,19 @@ let
|
||||||
|
|
||||||
assert n.sortedByIt(it) == @["b", "c"], "fine"
|
assert n.sortedByIt(it) == @["b", "c"], "fine"
|
||||||
assert q.sortedByIt(it[0]) == @[("b", "1"), ("c", "2")], "fails under arc"
|
assert q.sortedByIt(it[0]) == @[("b", "1"), ("c", "2")], "fails under arc"
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# issue #14236
|
||||||
|
|
||||||
|
type
|
||||||
|
MyType = object
|
||||||
|
a: seq[int]
|
||||||
|
|
||||||
|
proc re(x: static[string]): static MyType =
|
||||||
|
MyType()
|
||||||
|
|
||||||
|
proc match(inp: string, rg: static MyType) =
|
||||||
|
doAssert rg.a.len == 0
|
||||||
|
|
||||||
|
match("ac", re"a(b|c)")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue