Package org.sonar.python.types
Class UnknownClassType
java.lang.Object
org.sonar.python.types.UnknownClassType
- All Implemented Interfaces:
InferredType
This type is used for symbols that we assume to be class due to how they are used,
so that type inference correctly tracks objects that were created from this.
-
Field Summary
Fields inherited from interface org.sonar.plugins.python.api.types.InferredType
MOCK_FQNS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanBeOrExtend(String typeName) booleancanHaveMember(String memberName) booleanbooleandeclaresMember(String memberName) Used to handle uncertainty of declared types.booleanisCompatibleWith(InferredType other) booleanbooleanmustBeOrExtend(String typeName) mustBeOrExtend implies we know for sure the given type is either of the given typeName or a subtype of it.resolveDeclaredMember(String memberName) resolveMember(String memberName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sonar.plugins.python.api.types.InferredType
runtimeTypeSymbol
-
Constructor Details
-
UnknownClassType
-
-
Method Details
-
isIdentityComparableWith
- Specified by:
isIdentityComparableWithin interfaceInferredType
-
canHaveMember
- Specified by:
canHaveMemberin interfaceInferredType
-
declaresMember
Description copied from interface:InferredTypeUsed to handle uncertainty of declared types. It return false when a member is not present in a declared type, while canHaveMember returns true because one of its subtype may have it.- Specified by:
declaresMemberin interfaceInferredType
-
resolveMember
- Specified by:
resolveMemberin interfaceInferredType
-
resolveDeclaredMember
- Specified by:
resolveDeclaredMemberin interfaceInferredType
-
canOnlyBe
- Specified by:
canOnlyBein interfaceInferredType
-
canBeOrExtend
- Specified by:
canBeOrExtendin interfaceInferredType
-
isCompatibleWith
- Specified by:
isCompatibleWithin interfaceInferredType
-
mustBeOrExtend
Description copied from interface:InferredTypemustBeOrExtend implies we know for sure the given type is either of the given typeName or a subtype of it. As opposed to "canBeOrExtend", this will return true only when we are sure the subtyping relationship is present. For types inferred from type annotations (DeclaredType), the actual underlying type might be different from what has been declared, but it must be or extend the declared type.- Specified by:
mustBeOrExtendin interfaceInferredType
-
typeSymbol
-