mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-03 12:34:44 +00:00
Instantiates generics in the module that uses it (#22513)
Attempts to move the generic instantiation to the module that uses it. This should decrease re-compilation times as the source module where the generic lives doesnt need to be recompiled --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
11
tests/ic/tgenericinst.nim
Normal file
11
tests/ic/tgenericinst.nim
Normal file
@@ -0,0 +1,11 @@
|
||||
discard """
|
||||
cmd: "nim cpp --incremental:on $file"
|
||||
"""
|
||||
|
||||
{.emit:"""/*TYPESECTION*/
|
||||
#include <iostream>
|
||||
struct Foo { };
|
||||
""".}
|
||||
|
||||
type Foo {.importcpp.} = object
|
||||
echo $Foo() #Notice the generic is instantiate in the this module if not, it wouldnt find Foo
|
||||
Reference in New Issue
Block a user