diff --git a/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java b/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java index d570512e67c..048f5fedc10 100644 --- a/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java +++ b/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java @@ -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());