mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fixes #23233
This commit is contained in:
@@ -1234,7 +1234,7 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
|
||||
let
|
||||
lhs = x.skipGenericAlias
|
||||
rhs = y.skipGenericAlias
|
||||
if rhs.kind != tyGenericInst or lhs.base != rhs.base:
|
||||
if rhs.kind != tyGenericInst or lhs.base != rhs.base or rhs.kidsLen != lhs.kidsLen:
|
||||
return false
|
||||
for ff, aa in underspecifiedPairs(rhs, lhs, 1, -1):
|
||||
if not sameTypeAux(ff, aa, c): return false
|
||||
|
||||
@@ -9,7 +9,7 @@ float32
|
||||
"""
|
||||
|
||||
|
||||
import tables
|
||||
import std/tables
|
||||
|
||||
|
||||
block tgeneric0:
|
||||
@@ -166,3 +166,23 @@ type
|
||||
# bug #8295
|
||||
var x = AtomicContainer[int]()
|
||||
doAssert (ptr Block[int])(x.b) == nil
|
||||
|
||||
|
||||
# bug #23233
|
||||
type
|
||||
JsonObjectType*[T: string or uint64] = Table[string, JsonValueRef[T]]
|
||||
|
||||
JsonValueRef*[T: string or uint64] = object
|
||||
objVal*: JsonObjectType[T]
|
||||
|
||||
proc scanValue[K](val: var K) =
|
||||
var map: JsonObjectType[K.T]
|
||||
var newVal: K
|
||||
map["one"] = newVal
|
||||
|
||||
block:
|
||||
var a: JsonValueRef[uint64]
|
||||
scanValue(a)
|
||||
|
||||
var b: JsonValueRef[string]
|
||||
scanValue(b)
|
||||
|
||||
Reference in New Issue
Block a user