Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,6 @@ protected TypeAnnotator createTypeAnnotator() {
return new ListTypeAnnotator(new InterningTypeAnnotator(this), super.createTypeAnnotator());
}

@Override
public void addComputedTypeAnnotations(Tree tree, AnnotatedTypeMirror type, boolean useFlow) {
Element element = TreeUtils.elementFromTree(tree);
if (!type.isAnnotatedInHierarchy(INTERNED) && ElementUtils.isCompileTimeConstant(element)) {
type.addAnnotation(INTERNED);
}
super.addComputedTypeAnnotations(tree, type, useFlow);
}

@Override
public void addComputedTypeAnnotations(Element element, AnnotatedTypeMirror type) {
if (!type.isAnnotatedInHierarchy(INTERNED) && ElementUtils.isCompileTimeConstant(element)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public void viewpointAdaptMember(
if (!shouldAdaptMember(memberType, memberElement)) {
return;
}

AnnotatedTypeMirror decltype = atypeFactory.getAnnotatedType(memberElement);
AnnotatedTypeMirror combinedType = combineTypeWithType(receiverType, decltype);
memberType.replaceAnnotations(combinedType.getAnnotations());
Expand Down
17 changes: 17 additions & 0 deletions framework/tests/viewpointtest/AnnoOnTypeVariableUse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import viewpointtest.quals.*;
Comment thread
AndrewShf marked this conversation as resolved.

Comment thread
AndrewShf marked this conversation as resolved.
@SuppressWarnings("cast.unsafe.constructor.invocation")
class Demo<E> {
@ReceiverDependentQual E element;
Comment thread
AndrewShf marked this conversation as resolved.

static void test() {
Demo<@B Element> d = new @A Demo<@B Element>();
// d.element = @A |> @RDQ = @A
// thus expects no error here
d.element = new @A Element();
}
}

class Element {
int f = 1;
}