Skip to content

fix: correct StructureType comparator to compare s1 vs s2#8645

Closed
shuibui wants to merge 1 commit into
SkriptLang:masterfrom
shuibui:fix/structuretype-comparator
Closed

fix: correct StructureType comparator to compare s1 vs s2#8645
shuibui wants to merge 1 commit into
SkriptLang:masterfrom
shuibui:fix/structuretype-comparator

Conversation

@shuibui
Copy link
Copy Markdown

@shuibui shuibui commented May 14, 2026

Summary

Fix the StructureType comparator in DefaultComparators.java to correctly compare s1 vs s2 instead of comparing s2 against itself.

Bug

// Before (incorrect - compared s2 to itself)
return Relation.get(CollectionUtils.containsAll(s2.getTypes(), s2.getTypes()));

// After (correct - compares s1 to s2)
return Relation.get(CollectionUtils.containsAll(s1.getTypes(), s2.getTypes()));

Issue

Fixes #8638

Testing

The bug was identifiable from source inspection. The fix ensures the comparator correctly checks if s1's types contain all of s2's types, not both arguments being s2.

@shuibui shuibui requested a review from a team as a code owner May 14, 2026 09:10
@shuibui shuibui requested review from Absolutionism and Burbulinis and removed request for a team May 14, 2026 09:10
@skriptlang-automation skriptlang-automation Bot added needs reviews A PR that needs additional reviews needs triage An issue that hasn't been classified or verified yet labels May 14, 2026
@skriptlang-automation

This comment has been minimized.

@erenkarakal
Copy link
Copy Markdown
Member

This is already resolved in #8640
Closing

@skriptlang-automation skriptlang-automation Bot removed needs reviews A PR that needs additional reviews needs triage An issue that hasn't been classified or verified yet labels May 14, 2026
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.

Default comparator for tree types always returns EQUAL

2 participants