Superclass for custom transient ground types used by custom algorithms.
When writing algorithms that manipulate Types, it is sometimes useful
to temporarily store custom data in place of Types. This can be done
by defining a subclass of CustomTransientGroundType. At the end of the
day, all CustomTransientGroundTypes should have been replaced by proper
Types.
The methods of tasty-query never expose instances of
CustomTransientGroundType, but you may use it for your own purposes.
When permorming an exhaustive match on all possible Types, you should
cover CustomTransientGroundType in a case that always throws (unless
you are actually using it for some purposes):
val tpe: Type = ...
tpe match
case tpe: TypeRef => ...
...
case tpe: CustomTransientGroundType =>
throw AssertionError(s"Unexpected custom transient ground type $tpe")
end match
Is this type close enough to that type so that members with the two types would override each other?
Is this type close enough to that type so that members with the two types would override each other?
This means:
Either both types are polytypes with the same number of
type parameters and their result types match after renaming
corresponding type parameters
Or both types are method types with =:=-equivalent(*) parameter types
and matching result types after renaming corresponding parameter types
if the method types are dependent.
Or both types are =:=-equivalent
Or neither type takes term or type parameters.
(*) when matching with a Java method, we also regard Any and Object as equivalent parameter types. (TODO)
This function will always use unsafe-nulls semamtics to check the types.
This is because we are using a relaxed rule (ignoring Null types)
to check overriding Java methods.