Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
haewiful committed Oct 14, 2024
1 parent e1e2af5 commit 85e9e78
Showing 1 changed file with 25 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -898,36 +898,37 @@ public static Nullness getGenericParameterNullnessAtInvocation(

// Substitute the argument and return types within the MethodType
substitutedParamTypes =
state
.getTypes()
.subst(
methodTypeInsideForAll.argtypes,
forAllType.tvars, // The type variables from the ForAll
explicitTypeArgs // The actual type arguments from the method invocation
);
state
.getTypes()
.subst(
methodTypeInsideForAll.argtypes,
forAllType.tvars, // The type variables from the ForAll
explicitTypeArgs // The actual type arguments from the method invocation
);
if (Objects.equals(
getTypeNullness(substitutedParamTypes.get(paramIndex), config), Nullness.NULLABLE)) {
getTypeNullness(substitutedParamTypes.get(paramIndex), config), Nullness.NULLABLE)) {
return Nullness.NULLABLE;
}
}
// } else {
// // If it's not a ForAll type, handle it as a normal MethodType
// Type.MethodType methodTypeElse = (Type.MethodType) invokedMethodSymbol.type;
// substitutedParamTypes =
// state
// .getTypes()
// .subst(
// methodTypeElse.argtypes,
// invokedMethodSymbol.type.getTypeArguments(),
// explicitTypeArgs);
// }
// } else {
// // If it's not a ForAll type, handle it as a normal MethodType
// Type.MethodType methodTypeElse = (Type.MethodType) invokedMethodSymbol.type;
// substitutedParamTypes =
// state
// .getTypes()
// .subst(
// methodTypeElse.argtypes,
// invokedMethodSymbol.type.getTypeArguments(),
// explicitTypeArgs);
// }

// if (Objects.equals(
// getTypeNullness(substitutedParamTypes.get(paramIndex), config), Nullness.NULLABLE)) {
// return Nullness.NULLABLE;
// }
// if (Objects.equals(
// getTypeNullness(substitutedParamTypes.get(paramIndex), config), Nullness.NULLABLE)) {
// return Nullness.NULLABLE;
// }

// problem is that it returns nullable from the declaration even though the parameter itself is nonnull
// problem is that it returns nullable from the declaration even though the parameter itself is
// nonnull
if (!(tree.getMethodSelect() instanceof MemberSelectTree) || invokedMethodSymbol.isStatic()) {
return Nullness.NONNULL;
}
Expand Down

0 comments on commit 85e9e78

Please sign in to comment.