Skip to content

Conversation

@Simn
Copy link
Member

@Simn Simn commented Apr 19, 2025

It was found that when doing lhs == rhs, the compiler first tries to assign lhs to rhs and thus also prefers implicit casts in that direction, which seems unintuitive. This change flips the order and so the algorithm is this:

  1. try casting rhs to lhs
  2. if that fails, try casting lhs to rhs
  3. if that fails too, report the error from the first attempt

I think that's more natural. This is a pretty central change though because it has probably been like that since the original introduction of abstracts. Our unit tests seem fine but there's a failure in the tink tests:

Refs: [./tests/Refs.hx:6]
  testImplicit: [./tests/Refs.hx:7] 
    - [FAIL] [./tests/Refs.hx:9] r == 5 (@[5] == @[5])

cc @back2dos

@skial skial mentioned this pull request Apr 24, 2025
1 task
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.

2 participants