Package gw.lang.reflect
Interface IIntrinsicTypeReference
- All Known Subinterfaces:
IExpansionPropertyInfo
,IGosuMethodParamInfo
,IGosuPropertyInfo
,IGosuVarPropertyInfo
,IJavaBasePropertyInfo
,IJavaFieldPropertyInfo
,IJavaPropertyInfo
,IParameterInfo
,IPropertiesPropertyInfo
,IPropertyInfo
,IPropertyInfoDelegate
,ITypeInfoPropertyInfo
- All Known Implementing Classes:
ArrayExpansionPropertyInfo
,DynamicPropertyInfo
,ErrorTypeInfo.UniversalProperty
,GosuMethodParamInfo
,GosuPropertyInfo
,GosuVarPropertyInfo
,JavaFieldPropertyInfo
,JavaMethodParamInfo
,JavaPropertyInfo
,LengthProperty
,MetaPropertyInfoDelegate
,MetaTypeTypeInfo.DeprecatedStaticPropertyInfoDelegate
,MetaTypeTypeInfo.TypeProperty
,ModifiedParameterInfo
,PackagePropertyInfo
,ParameterInfoBuilder.BuiltParameterInfo
,ParameterInfoPopup.ParameterInfoStub
,ParameterizedGosuPropertyInfo
,PropertiesPropertyInfo
,PropertyInfoBase
,PropertyInfoBuilder.BuiltPropertyInfo
,PropertyInfoDelegate
,SimpleParameterInfo
,StaticPropertyInfo
,TypedParameterDescriptor
,TypedPropertyDescriptor
,TypePropertyInfo
public interface IIntrinsicTypeReference
-
Method Summary
Modifier and TypeMethodDescriptiondefault IType
The type this feature can be assigned from.The type of this feature e.g., for a property this is the property's type.
-
Method Details
-
getFeatureType
IType getFeatureType()The type of this feature e.g., for a property this is the property's type. -
getAssignableFeatureType
The type this feature can be assigned from. Most of the time this is the same type as getFeatureType(), however it can be different and when it is it should almost always be contravariant with getFeatureType(). A property setter method is the primary use-case. For instance:interface Foo { property Name: CharSequence } class FooImpl implements Foo { var _name: String override property get Name(): String { return _name } override property set Name( cs: CharSequence ) { _name = cs.toString() } }
Here FooImpl overrides Foo's Name property with covariance on the getter's return type. This establishes that Name wrt FooImpl is of type String. Yet Foo's setter method must be overridden as-is, a method cannot override another method with covariant parameters. So, in terms of FooImpl's Name property, the setter method is contravariant with String, which again is Name's type wrt of FooImpl. Therefore, FooImpl's Name property should implement getAssignableFeatureType() and return CharSequence.
-