Open wjoel opened 3 months ago
Maybe https://github.com/scala/scala3/issues/13841 which turns on a package-private parent. (I haven't looked at this example yet.) That ticket has an open PR.
Edit: I applied both fixes, but it doesn't change this result.
Thanks for testing that, @som-snytt! Too bad it didn't help.
I'm now even more convinced that this is related, and perhaps a duplicate of, #16779. It seems we end up with those path-dependent types in Scala 3 when using Java interfaces that have wildcard types and "interesting" inheritance, but not in Scala 2.
The "use Java rules to look up types" was forward-ported, and I noticed it wasn't quite a clean port, so it wouldn't surprise me that additional subtlety is at play. (That's as far as I got with that angle.)
Compiler version
3.4.3, and all previous versions of Scala 3 that I've tested. Crashes on 3.5.0, fixed by https://github.com/scala/scala3/pull/21522, but it has the same (wrong) types as 3.4.3 after that fix.
Minimized code
Output
Expectation
The code should compile, as it does when using Scala 2.13. Also, the type of the first assignment should be a
Box
(as on Scala 2, and Java), not aWidget
.I believe this may be related to https://github.com/scala/scala3/issues/16779.