Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.
This repository was archived by the owner on May 12, 2025. It is now read-only.

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

Open
@traceyyoshima

Description

@traceyyoshima
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions