You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Cxx to interface a fairly complicated C++ library. A test case that worked fine in July (I think I was using Julia 1.1 and Cxx 0.3.x) failed with Julia 1.3.1 and Cxx 0.4.0.
I tried to understand what was happening (I can safely say that this code is way beyond my competence level), but the following patch in Cxx got it working again:
$ git diff
diff --git a/src/typetranslation.jl b/src/typetranslation.jl
index aa5e370..b82b290 100644
--- a/src/typetranslation.jl
+++ b/src/typetranslation.jl
@@ -292,7 +292,7 @@ function cpptype(C,::Type{T}) where T
InverseMappedTypes[MappedTypes[T]] = T
# For callable julia types, also add an operator() method to the anonymous
# class
- if !isempty(T.name.mt)
+ if !isempty(T.name.mt) && isa(T.name.mt.defs, Core.TypeMapEntry)
linfo = T.name.mt.defs.func
sig = T.name.mt.defs.sig
nargt = length(sig.parameters)-1
What I think caused the problem was that in the testcase, one of the parameters to a C++ function was an empty array (Array{Complex{Float64}}(undef, 0, 0)) and that confused Cxx type translation. Since I hardly understand what I'm doing, I welcome someone with the proper competence to make a proper patch.
The text was updated successfully, but these errors were encountered:
I'm using Cxx to interface a fairly complicated C++ library. A test case that worked fine in July (I think I was using Julia 1.1 and Cxx 0.3.x) failed with Julia 1.3.1 and Cxx 0.4.0.
I tried to understand what was happening (I can safely say that this code is way beyond my competence level), but the following patch in Cxx got it working again:
What I think caused the problem was that in the testcase, one of the parameters to a C++ function was an empty array (
Array{Complex{Float64}}(undef, 0, 0)
) and that confused Cxx type translation. Since I hardly understand what I'm doing, I welcome someone with the proper competence to make a proper patch.The text was updated successfully, but these errors were encountered: