For example: a new Gtk Frame can be constructed with:
public Frame(@Nullable String label)
The label argument is optional, and will often be null. However, because all Java-GI classes contain a constructor with a single MemorySegment argument, the null argument must be explicitly cast to String like this:
var frame = new Frame((String) null);
or for example in Scala:
val frame = Frame(null.asInstanceOf[String])
This can be resolved by generating an extra constructor in this case, that simply calls this((String) null);
For example: a new Gtk Frame can be constructed with:
The label argument is optional, and will often be
null
. However, because all Java-GI classes contain a constructor with a singleMemorySegment
argument, thenull
argument must be explicitly cast toString
like this:or for example in Scala:
This can be resolved by generating an extra constructor in this case, that simply calls
this((String) null);