Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Created March 13, 2015 18:54
Show Gist options
  • Save fowlmouth/203aa476a0f3c0c2996b to your computer and use it in GitHub Desktop.
Save fowlmouth/203aa476a0f3c0c2996b to your computer and use it in GitHub Desktop.
{.emit:"""
struct FooBase {
int x;
};
template <typename T>
struct Foo: FooBase {
T val;
};
""".}
type
FooBase*{.importcpp, inheritable.} = object
Foo*{.importcpp.}[T] = object of FooBase
val*: T
var f1: FooBase # fine
var f2: Foo[int] # causes error:
# testcpp.nim(17, 8) Error: internal error: mangleRecFieldName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment