diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/generics/mdotlookup.nim | 8 | ||||
-rw-r--r-- | tests/generics/tdotlookup.nim | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/generics/mdotlookup.nim b/tests/generics/mdotlookup.nim new file mode 100644 index 000000000..7a5e0ccbf --- /dev/null +++ b/tests/generics/mdotlookup.nim @@ -0,0 +1,8 @@ +proc baz(o: any): int = 5 # if bar is exported, it works + +type MyObj = object + x: int + +proc foo*(b: any) = + var o: MyObj + echo b.baz, " ", o.x.baz, " ", b.baz() diff --git a/tests/generics/tdotlookup.nim b/tests/generics/tdotlookup.nim new file mode 100644 index 000000000..b886cd8c9 --- /dev/null +++ b/tests/generics/tdotlookup.nim @@ -0,0 +1,7 @@ +discard """ + output: '''5 5 5''' +""" + +import mdotlookup + +foo(7) |