Closed bishabosha closed 1 year ago
This is actually strange, A[=B] must be a subtype of A[+B], I guess the representation does not represent what's actually wrong there. We will have a look.
@bishabosha : could you make a minimal isolated repro please?
@bishabosha
This is caused by a change/regression in one of the latest Scala 3.3 commits, HKTypeLambda#declaredVariances
(private API used here - there's no public way to get variance of type parameters) is not returning the correct variance for some reason, causing all tags to be generated as invariant.
This change happened somewhere between the latest RC6 and scala-3.3.1-RC1-bin-20230331-7262437-NIGHTLY which is a tested version that doesn't appear to have this problem.
@pshirshov
This is actually strange, A[=B] must be a subtype of A[+B], I guess the representation does not represent what's actually wrong there.
It's a subtype, but not equal wrt equals
/=:=
and also not equal as a binary string, so them not being exactly the same is probably triggering that failure.
I guess that should be immediately reported...
@bishabosha
No need for a repro, since this reproduces with just Tag[List[Int]]
on 3.3.0-RC6, but also I'm not exactly sure this can be fixed on our side. I would expect either declaredVariances
to have kept working or another API to replace it. (There is a ticket for a public API - https://github.com/lampepfl/dotty/issues/16734)
I'm wondering why did this happen. Isn't our IR included into the community build?
I'm wondering why did this happen. Isn't our IR included into the community build?
the last update to that was 2021 (the one that's a git submodule)
@bishabosha Is there an expectation for us to send PRs to update the version in community build to keep it up to date? We're also in VirtusLab's community build, but that couldn't detect this change because they don't run the tests in that build - compilation succeeds in this case.
Is there an expectation for us to send PRs to update the version in community build to keep it up to date?
We don't have any process for keeping the dotty community-build projects up to date - so any help from the original maintainers is appreciated.
I would guess the reason is that a lot of these projects were ad-hoc forks made before the projects themselves had migrated to scala 3, now that they are publishing for scala 3 theoretically its less effort.
Is this something that can be "worked around" by having less powerful type lambdas? otherwise this should probably be escalated as a dotty bug even though you relied on non-public api
@neko-kai does this help? https://github.com/lampepfl/dotty/pull/17554 - it seems that variances should be computed by inspecting occurrences of the type parameters in the hk lambda's structure
@bishabosha I'll try that
@adamgfraser I'd recommend to release a new ZIO version with update to izumi-reflect 2.3.8 to avoid users getting hit by this regression if they update to Scala 3.3.0
@neko-kai Will do!
see https://github.com/zio/zio/issues/8130 (I was asked to reopen here), and https://github.com/softwaremill/realworld-tapir-zio/issues/107