Files
Nim/tests/errmsgs/tnested_generic_instantiation2.nim
Andreas Rumpf 766960dc15 fixes #11515 (#11624)
* fixes #11515

* better fix for #11515; make tests green
2019-07-01 18:08:50 +02:00

28 lines
415 B
Nim

discard """
action: compile
"""
#[
bug #4766
see also: tnested_generic_instantiation.nim
]#
proc toString*[T](x: T) =
for name, value in fieldPairs(x):
when compiles(toString(value)):
discard
toString(value)
type
Plain = ref object
discard
Wrapped[T] = object
value: T
converter toWrapped[T](value: T): Wrapped[T] =
Wrapped[T](value: value)
let result = Plain()
toString(result)