Skip to content

Commit

Permalink
Invoke viewpointAdaptConstructor also for super constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Ao-senXiong committed Sep 30, 2024
1 parent df8a262 commit 8228faa
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2925,9 +2925,12 @@ public ParameterizedExecutableType constructorFromUse(NewClassTree tree) {
AnnotatedExecutableType superCon =
getAnnotatedType(TreeUtils.getSuperConstructor(tree));
constructorFromUsePreSubstitution(tree, superCon);
// no viewpoint adaptation needed for super invocation
superCon =
AnnotatedTypes.asMemberOf(types, this, type, superCon.getElement(), superCon);
// Adapt the result from super constructor as it will be used in anonymous constructor.
if (viewpointAdapter != null) {
viewpointAdapter.viewpointAdaptConstructor(type, ctor, superCon);
}
con.computeVarargType(superCon);
if (superCon.getParameterTypes().size() == con.getParameterTypes().size()) {
con.setParameterTypes(superCon.getParameterTypes());
Expand Down

0 comments on commit 8228faa

Please sign in to comment.