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

[Typecheck] Redundant check of invalid type annotation #60

Open
Ao-senXiong opened this issue Jul 17, 2024 · 1 comment
Open

[Typecheck] Redundant check of invalid type annotation #60

Ao-senXiong opened this issue Jul 17, 2024 · 1 comment

Comments

@Ao-senXiong
Copy link

Ao-senXiong commented Jul 17, 2024

In type check, the inivalid type annotation should all be checked validator. However, the visitor also check for invalid annotation at https://github.com/Ao-senXiong/immutability/blob/07f7ee903d48d08c034b522b14feb680c1195cc5/src/main/java/pico/typecheck/PICONoInitVisitor.java#L391. Think about how to unify them and move to validator.

Why? Because there are redundant error messages that might cause confusion.

@Ao-senXiong
Copy link
Author

Unified the conflict annotation check in Ao-senXiong@4eae21e.

One corner case is, there is currently no error at first A a4.

public class ConflictAnnotationTest {
    @Mutable class A {}
    @Immutable class B {}
    @ReceiverDependentMutable class C {}
    class MutableClass {
        @ReceiverDependentMutable A a4;
        @ReceiverDependentMutable B b4;
    }

    @Immutable class ImmutableClass {
        @ReceiverDependentMutable A a4;
        @ReceiverDependentMutable B b4;
    }

    @ReceiverDependentMutable class ReceiverDependentMutableClass {
        @ReceiverDependentMutable A a4;
        @ReceiverDependentMutable B b4;
    }
}

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

No branches or pull requests

1 participant