fixes 9195 (#12055)

This commit is contained in:
Andreas Rumpf 2019-08-27 10:07:42 +02:00 • committed by GitHub
commit b044523c5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 3 deletions

View file

@ -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)