We're updating the issue view to help you get more done. 

Implement type unification to fix equality of TypeInstantiation, MethodInstantiation, **OnTypeInstantiation members, ArrayType, and ByRefType

Description

Implement unification for:

  • TypeInstantiation (automatically causes ***OnTypeInstantiation classes to be unified, including MemberParameterOnInstantiation)

  • arrays: VectorType, MultiDimensionalArrayType, ArrayTypeBase.

  • byref: ByRefType

  • MethodInstantiation (optional, not required to be reference-equal by Reflection; can also be implemented via overriding Equals)

  • Remove equality members on TypeInstantiation, VectorType, ByRefType;

  • Adapt docs.

  • Create scoped cache for TypeInstantiations; i.e., only a single Type instance for a logical type (as in original reflection).

    • Remove TypeInstantiation.Equals and adapt TypeExtensions.IsAssignableFromFast.

    • Remove ArrayTypeBase.Equals.

    • Remove 'instantiationContext' parameter from TypeSubstitutionUtility.SubstituteGenericParameters.

  • Also make member/interface/base type initialization in TypeInstantiation lazy, like within ArrayTypeBase's ctor.

    • Still TODO: TypeInstantiationContext now does not need to cache/unify TypeInstantiations because we deal with endless recursion by just lazily evaluating base type/interfaces/member instantiations. Therefore this class could be a simple static utility without state.

Assignee

Unassigned

Reporter

User known

Labels

None

Components

Fix versions

Priority

Normal
Configure