diff options
Diffstat (limited to 'tests/sandwich')
-rw-r--r-- | tests/sandwich/generic_library.nim | 6 | ||||
-rw-r--r-- | tests/sandwich/helper_module.nim | 3 | ||||
-rw-r--r-- | tests/sandwich/module_using_generic_library.nim | 12 | ||||
-rw-r--r-- | tests/sandwich/tmain.nim | 9 |
4 files changed, 30 insertions, 0 deletions
diff --git a/tests/sandwich/generic_library.nim b/tests/sandwich/generic_library.nim new file mode 100644 index 000000000..43e7bd65f --- /dev/null +++ b/tests/sandwich/generic_library.nim @@ -0,0 +1,6 @@ + +proc libraryFunc*[T](x: T) = + mixin mixedIn, indirectlyMixedIn + echo mixedIn() + echo indirectlyMixedIn() + diff --git a/tests/sandwich/helper_module.nim b/tests/sandwich/helper_module.nim new file mode 100644 index 000000000..d003bf044 --- /dev/null +++ b/tests/sandwich/helper_module.nim @@ -0,0 +1,3 @@ + +proc indirectlyMixedIn*: int = + 200 diff --git a/tests/sandwich/module_using_generic_library.nim b/tests/sandwich/module_using_generic_library.nim new file mode 100644 index 000000000..bbb0d92a4 --- /dev/null +++ b/tests/sandwich/module_using_generic_library.nim @@ -0,0 +1,12 @@ + +import + generic_library, helper_module + +proc mixedIn: int = 100 + +proc makeUseOfLibrary*[T](x: T) = + bind mixedIn, indirectlyMixedIn + libraryFunc(x) + +when isMainModule: + makeUseOfLibrary "test" diff --git a/tests/sandwich/tmain.nim b/tests/sandwich/tmain.nim new file mode 100644 index 000000000..aa50bfb04 --- /dev/null +++ b/tests/sandwich/tmain.nim @@ -0,0 +1,9 @@ +discard """ + output: '''100 +200''' +""" + +import + module_using_generic_library + +makeUseOfLibrary "test" |