mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-23 01:48:18 +00:00
allow null to be cast to any non-primitve
This commit is contained in:
@@ -1072,6 +1072,10 @@ function isTypeCastable(source_type, cast_type) {
|
|||||||
// everything is castable to Object
|
// everything is castable to Object
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (source_type instanceof NullType) {
|
||||||
|
// null is castable to any non-primitive
|
||||||
|
return !(cast_type instanceof PrimitiveType);
|
||||||
|
}
|
||||||
if (source_type instanceof CEIType && cast_type instanceof CEIType) {
|
if (source_type instanceof CEIType && cast_type instanceof CEIType) {
|
||||||
if (source_type.typeKind === 'interface') {
|
if (source_type.typeKind === 'interface') {
|
||||||
// interfaces are castable to any non-final class type (derived types might implement the interface)
|
// interfaces are castable to any non-final class type (derived types might implement the interface)
|
||||||
|
|||||||
Reference in New Issue
Block a user