swiftlang/swift-java

jextract: Hide constructors (pointer, arena) because they are too easy to mistakenly call

Closed this issue · 0 comments

This looks right:

new Data(bytes, arena)

but is super wrong, because this just wraps the pointer to the types, but instead we want to

Data.init(bytes, arena),

which runs the Data initializer.

We should hide the constructors and offer them via a well named "scary" method name