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

Type validation enhancement: Track the owner of identifiers to validate aliases. #545

Open
traceyyoshima opened this issue Dec 13, 2023 · 0 comments
Labels
enhancement New feature or request priority:low

Comments

@traceyyoshima
Copy link
Contributor

import java.util.regex.Pattern.CASE_INSENSITIVE as i

class A {
    val f = arrayOf(i)
}

Type validation on identifiers compares the name of JavaType.Variable on J.Identifier#fieldType to ensure the names match. Type aliases fail the comparison and cause a test failure.

We can track the scope of a variable through a stack so that the identifiers are compared to the applicable field type when it exists. The changes will help to reveal when types are not correctly updated, and allow us to apply the correct validation on aliases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:low
Projects
Status: Backlog
Development

No branches or pull requests

1 participant