eclipse-jdt / eclipse.jdt.core

Eclipse Public License 2.0
156 stars 123 forks source link

[21][record patterns][type inference] validate the theta-substitution is doing the right thing #1343

Open mpalat opened 1 year ago

mpalat commented 1 year ago

Ref: https://github.com/eclipse-jdt/eclipse.jdt.core/pull/1341#discussion_r1313827524

--snip--- private TypeVariableBinding[] getTPrimeArgumentsAndCreateBounds( ParameterizedTypeBinding parameterizedType, InferenceVariable[] beta) { TypeBinding[] arguments = parameterizedType.typeArguments(); TypeVariableBinding[] typeVariables = new TypeVariableBinding[arguments.length]; InferenceSubstitution theta = new InferenceSubstitution(this.environment, beta, this.currentInvocation);

Here and usage of theta below: update from the spec where it says: "let θ be the substitution[Z1:=β1, ..., Zk:=βk]. T' is Tc θ." etc.

and https://github.com/eclipse-jdt/eclipse.jdt.core/pull/1341#issuecomment-1704411918 validate the theta-substitution is doing the right thing, perhaps using examples for more complex inference situations

stephan-herrmann commented 1 year ago

Does #1361 exercise this code?

mpalat commented 12 months ago

Does #1361 exercise this code?

no