Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt type use based on class bound #1032

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

Ao-senXiong
Copy link
Member

No description provided.

Copy link
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@Ao-senXiong Ao-senXiong changed the title Add method call for testing RD class substitution Adapt type use for receiver type Jan 24, 2025
@@ -15,9 +15,27 @@
this.f = new @ReceiverDependentQual Object();
}

// This method could be called by both @A and @B instances.
void recieverDependentMethod(@ReceiverDependentQual TestGetAnnotatedLhs this) {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the test for testing the new change.

@Ao-senXiong
Copy link
Member Author

To summarize this PR:

  1. Adding getAdaptedTypeDeclarationBounds for well formed type use. Every type used is checked to be supertype of type use adapt its bound. Formally, q |> bound(C) <: q.
  2. Override CheckConstructorReturn method to make remove a few warnings about inconsistent constructor return type. I think this make sense because create @A C c should be legal in @A class C{} in the system.
  3. Change the qualifier default from @Top to @A. We should resctrict the class bound from the top type to more concret types such as @A, @B and @RDQ.

This help us eliminate many errors message.

@Ao-senXiong Ao-senXiong requested a review from wmdietl January 24, 2025 05:06
@Ao-senXiong Ao-senXiong assigned wmdietl and unassigned Ao-senXiong Jan 24, 2025
@Ao-senXiong Ao-senXiong changed the title Adapt type use for receiver type Adapt type use based on class bound Jan 24, 2025
@Ao-senXiong
Copy link
Member Author

I think the misc check sometimes fails but not always with the following error message:

Fetched 319 MB in 12s (26.1 MB/s)
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/u/util-linux/uuid-dev_2.39.3-9ubuntu6.1_amd64.deb  404  Not Found [IP: 52.252.75.106 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

result.addAll(
((AbstractViewpointAdapter) viewpointAdapter)
.combineAnnotationWithType(anno, useType)
.getAnnotations());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why adapting anno with useType, should it be useType adapt anno?

AnnotationMirrorSet result = new AnnotationMirrorSet();
for (AnnotationMirror anno : getTypeDeclarationBounds(type)) {
result.addAll(
((AbstractViewpointAdapter) viewpointAdapter)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expose method in the interface and remove this downcast.

@Ao-senXiong Ao-senXiong assigned Ao-senXiong and unassigned wmdietl Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants