Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Handle NewClassTree for constructor type substitution in compareGener…
…icTypeParameterNullabilityForCall(#1212)
  • Loading branch information
dhruv-agr committed May 27, 2025
commit 3e003996133ac15d1de146604cc0d69aa5cec2f2
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,16 @@ public void compareGenericTypeParameterNullabilityForCall(
TypeSubstitutionUtils.memberType(state.getTypes(), enclosingType, methodSymbol, config);
}
}

// substitute type arguments for constructor call
if (tree instanceof NewClassTree) {
Type enclosingType = getTreeType(tree, config);
Comment thread
dhruv-agr marked this conversation as resolved.
if (enclosingType != null) {
invokedMethodType =
TypeSubstitutionUtils.memberType(state.getTypes(), enclosingType, methodSymbol, config);
}
}

// substitute type arguments for generic methods with explicit type arguments
if (tree instanceof MethodInvocationTree && methodSymbol.type instanceof Type.ForAll) {
invokedMethodType =
Expand Down