Skip to content

Allow compatible type when targetting object types in linter#53

Open
Lulu13022002 wants to merge 2 commits into
FabricMC:masterfrom
Lulu13022002:fix/validator
Open

Allow compatible type when targetting object types in linter#53
Lulu13022002 wants to merge 2 commits into
FabricMC:masterfrom
Lulu13022002:fix/validator

Conversation

@Lulu13022002

@Lulu13022002 Lulu13022002 commented May 29, 2026

Copy link
Copy Markdown

Closes #50

This removes the unpickable type check and instead just check for compatible usage later which allow to not fail at the first linter issue. It might be interesting to extend this to support primitive too with their boxed equivalent later.
It effectively now match the implementation which never really respected this part of the specs: https://github.com/Vineflower/unpick-parser/blob/main/spec.md#targets

I didn't find any jdk/asm example for the target_field test so that is still pending.

@Earthcomputer

Copy link
Copy Markdown

I don't fully understand this change yet but I find it concerning that that test has been removed, that's an important check. Also, the spec does not allow for CharSequence to be unpicked, so it's a spec issue -- see the bullet point on compatible types in the targets section. Maybe something can be added to the spec about CharSequence specifically, and then we can solve this.

@Lulu13022002

Lulu13022002 commented May 30, 2026

Copy link
Copy Markdown
Author

CharSequence is still not allowed as a group data type and will fails in the parser. This expand the later check to allow CharSequence to be used in target definitions (when the declared group is a String). But it's not specific to CharSequence the example provided in the linked issue should work for Object/Serializable and whatever type fitting a String.

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.

Validator is too strict with allowed types

2 participants