Skip to content

Commit 6873d82

Browse files
committed
BridJ: throw when C++ constructor is not found.
1 parent b5a262a commit 6873d82

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/org/bridj/cpp/CPPRuntime.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,9 @@ public boolean accept(Symbol symbol) {
674674
}
675675
});
676676
if (symbol == null) {
677-
if (debug) {
677+
if (constructorId >= 0) {
678+
throw new RuntimeException("No matching constructor for " + Utils.toString(type) + " (" + constr + ")");
679+
} else if (debug) {
678680
BridJ.info("No matching constructor for " + Utils.toString(type) + " (" + constr + ")");
679681
}
680682
return null;

0 commit comments

Comments
 (0)