Skip to content

Conversation

@Akirathan
Copy link
Member

@Akirathan Akirathan commented Dec 9, 2025

Fixes #14426

Pull Request Description

Fixes pattern matching on Java integer and long fields.

Important Notes

Fallback case branch in DuckDB_Type_Mapping.enso no longer necessary - removed in 2a84ac4. See #14423 (comment)

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

@Akirathan Akirathan self-assigned this Dec 9, 2025
@Akirathan Akirathan added the CI: No changelog needed Do not require a changelog entry for this PR. label Dec 9, 2025
@Akirathan Akirathan changed the title Minimal reproducer Fix pattern matching on Java fields Dec 9, 2025
@Akirathan Akirathan changed the title Fix pattern matching on Java fields Fix pattern matching on Java integer field Dec 9, 2025
@Akirathan Akirathan marked this pull request as ready for review December 9, 2025 15:38
Copy link
Collaborator

@hubertp hubertp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about Byte, Short, Double?

Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I don't think IsSameObjectNode is the right place to handle non-long integers
  • values allowed to flow in Enso interpreter are
    • long, double, boolean, TruffleObject
  • I am not sure what exactly is left or right in this case
  • but we certainly don't want any other values than the allowed ones

@Akirathan
Copy link
Member Author

values allowed to flow in Enso interpreter are: long, double, boolean, TruffleObject

Yes. The failure was happening when there were two java.lang.Long. Specialization simplified in 3bfd0bc

}

@Specialization
boolean isSameLong(long left, long right) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like the right specialization.

@Akirathan Akirathan merged commit 3827a5b into develop Dec 10, 2025
107 of 111 checks passed
@Akirathan Akirathan deleted the wip/akirathan/14426-java-sql-types-match branch December 10, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: No changelog needed Do not require a changelog entry for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Numerical value fails to pattern match on a polyglot symbol's field of the same value

5 participants