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

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

Projects

None yet

2 participants

@endragor
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 from Compile-time SIGSEGV when declaring method with return value to Compile-time SIGSEGV when declaring .importcpp method with return value Feb 10, 2016
@Araq
Member
Araq commented Feb 10, 2016

You cannot importc(pp) methods.

@endragor
Contributor

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.

@Araq Araq added the Crash label May 31, 2016
@Araq Araq added a commit that closed this issue Dec 30, 2016
@Araq Araq fixes #3848 4500163
@Araq Araq closed this in 4500163 Dec 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment