fixes 9195 (#12055)
This commit is contained in:
parent
5a9edb222b
commit
b044523c5a
3 changed files with 35 additions and 3 deletions
|
|
@ -48,3 +48,27 @@ doAssert hasDefault2(int) == "int"
|
|||
doAssert hasDefault2(string) == "string"
|
||||
doAssert hasDefault2() == "string"
|
||||
|
||||
|
||||
# bug #9195
|
||||
type
|
||||
Error = enum
|
||||
erA, erB, erC
|
||||
Result[T, U] = object
|
||||
x: T
|
||||
u: U
|
||||
PB = object
|
||||
|
||||
proc decodeUVarint*(itzzz: typedesc[SomeUnsignedInt],
|
||||
data: openArray[char]): Result[itzzz, Error] =
|
||||
result = Result[itzzz, Error](x: 0, u: erC)
|
||||
|
||||
discard decodeUVarint(uint32, "abc")
|
||||
|
||||
type
|
||||
X = object
|
||||
Y[T] = object
|
||||
|
||||
proc testObj(typ: typedesc[object]): Y[typ] =
|
||||
discard
|
||||
|
||||
discard testObj(X)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue