Add cast() method #305
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
java
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
java-gi/java-gi!305
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cast-method"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This allows to cast a type instance to another type, even if the Java type would not allow it.
This is of course terribly unsafe, but there is a runtime check using
g_type_is_a()so at least there's a runtime type check.The cast is intended to be used in some special cases:
cast()method introduced here, to "cast" the class to the parent type, it becomes possible again to call the instance method.