Nim/tests/generics/mdotlookup.nim
Timothee Cour 24445d31b3
improve several tests in testament (#18635)
* silence error output from template_various.nim

* any => auto in tests

* avoid showing failed for parseSpec since this is expected behavior in 2 cases: tincludefile.nim, tnav1.nim

* enforce InheritFromException

* fixup
2021-08-08 19:28:49 +02:00

16 lines
286 B
Nim

proc baz(o: auto): int = 5 # if bar is exported, it works
type MyObj = object
x: int
proc foo*(b: auto) =
var o: MyObj
echo b.baz, " ", o.x.baz, " ", b.baz()
import sets
var intset = initHashSet[int]()
proc fn*[T](a: T) =
if a in intset: echo("true")
else: echo("false")