Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile-time SIGSEGV when declaring .importcpp method with return value #3848

Closed
endragor opened this issue Feb 10, 2016 · 2 comments
Closed

Comments

@endragor
Copy link
Contributor

Sample:

type MyObject {.importcpp: "MyObject", nodecl.} = object
method aMethod(this: ptr MyObject): bool {.importcpp: "aMethod", nodecl, base.}

Works fine if you remove bool return type from the method declaration. Also works fine if you replace method with proc.

@endragor endragor changed the title Compile-time SIGSEGV when declaring method with return value Compile-time SIGSEGV when declaring .importcpp method with return value Feb 10, 2016
@Araq
Copy link
Member

Araq commented Feb 10, 2016

You cannot importc(pp) methods.

@endragor
Copy link
Contributor Author

Yes, I guessed that. Though I found it useful when interfacing with large class hierarchies - it helps to identify occasional redeclaration of methods that were already declared for parent types (considering you mark all methods with {.base.} pragma). It also acts as a hint that this function is virtual in C++ code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants