-
Notifications
You must be signed in to change notification settings - Fork 1.1k
handle AnnotatedTypes transparently #350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
See t3252 for a test case.
Reformulated matchign spec and implemented accordingly. Previous fix for scala#329 would have missed third new error case in over.scala.
1) Drop redundant signature comparison in overriding pairs 2) Abstract from repeated parameters when calculating matches
This was a left-over from a failed attempt to have OverridingPiars work exclusively by comparing signatures. If we do that then repeated and underlying do have the same signature and therefore are supposed to match. But as @retronym notes, this leads to problems. In any case, we no longer try to make overriding pairs work that way, because it fails for other reasons as well.
… Any Fixes two bugs needed for java-override test: Namer was creating a MethodType instead of a JavaMethodType even though the JavaDefined flag was set on the DefDef. Following Scalac, Namer needs to convert Java method parameters of type j.l.Object to s.Any.
|
I fixed a few more cases where AnnotatedTypes were not handled transparently. This fixes the neg_i0091_infpaths test. |
but that's by accident, I guess, because it changes the completion order. So it's not clear if the problem is really fixed, or just "not exposed any more by neg/i0091_infpaths". |
|
No, the |
|
It was only a problem when types have annotations, because the AnnotatedTypes were not being handled transparently in many places (including |
|
Ok, got it, so that commit message has to be understood as " |
|
Oh, right, I see why it is confusing. I should probably squash the two commits into one, with only the commit message of the first one, with no mention of the specific test (since before the first commit, almost all of the tests fail if types have annotations). Would that make sense? |
|
I think so :) |
In Erasure, all type annotations are dropped (AnnotatedTypes are replaced with their underlying).
211fe56 to
20673f4
Compare
|
I have squashed the two commits. Sorry for the confusion. |
|
I investigated the failure in
Still in Why does this not happen when types are not annotated? |
Most phases actually transform the tree at Can you please tell me how to reproduce the particular error that you are seeing(and maybe share an error log). |
|
The problem has nothing to do with the You can get my branch here: olhotak/dotty@b5e05fde5 Here is the output: https://gist.github.com/olhotak/67c4aca12a1b39814643 |
Backport "Warn if interpolator uses toString" to 3.3 LTS
Fix val parameter override problem v0.2.1 -- fix potential IDB API issue dep: update a whole bunch of things (scala#71) This pr updates the following: - various dependencies to the latest - adds in dependabot - updates java and checkout actions - updates ammonite scripts and uses new ammonite in CI - updates mill to the latest 0.10.5 - bumps scalajs to 1.x - corrects repo location in pomSettings Merge pull request scala#4238 from armanbilge/issue/4229 Build docs on 2.13 Merge pull request scala#350 from typelevel/update/sbt-typelevel-0.4.13 Update sbt-typelevel to 0.4.13 Merge pull request scala#187 from typelevel/update/sbt-typelevel-0.4.13 Update sbt-typelevel to 0.4.13 Merge pull request scala#318 from scala-steward/update/sbt-typelevel-0.4.3 Update sbt-typelevel, sbt-typelevel-site to 0.4.3 fix http4s output encoding to UTF-8 (scala#900) support scala 3.0.0 Migrate to sbt slash syntax Merge pull request scala#2951 from pchlupacek/patch-1 Update adopters.md Adapt to new restrictions in fewerBraces wip: cleanups Reduce program size in one of the tests to decrease the chance of stack overflow. v4.6.0 Update scalafmt-core to 3.4.0 Remove import suggestions from assertions Clarify the unit of proc().call() 'timeout' parameter (scala#107) Pull request: com-lihaoyi/os-lib#107 Setting version to 2.4.1-SNAPSHOT Update auxlib, javalib, junit-plugin, ... to 0.4.3 Update serialization base64 for new lazy vals Merge pull request scala#616 from SethTisue/enable-scala-3-publishing Disable ExpectationsSpecs message tests Fix test for change in union type inference empty Merge pull request scala#380 from scala-steward/update/sbt-typelevel-0.4.3 Update sbt-typelevel to 0.4.3 Update scalafmt-core to 3.7.12 (scala#163) Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com> test: use the same line numbers in the location spec regardless of the scala compiler version Disable buggy test See scala#16390 New reference compiler is Scala 2.13.12 deps: update a bunch of things (scala#395) * deps: update a bunch of things This updates the following: - make sure Mill is on the latest 0.10.5 - drops support for scalajs 0.x - bumps to the latest scala patch versions - bumps to the latest scalaJS and scala native - bumps to 0.8.0 of utest - adds in dependabot - adds in cross testing jdk for 8 and 17 - bumps version of checkout and java actions * refactor: restructure build to actually build * fix: make mima happy by updating Merge pull request scala#264 from scala-steward/update/test-interface-0.4.7 Update test-interface to 0.4.7 Merge pull request scala#183 from scala-steward/update/auxlib-0.4.3 Update auxlib, javalib, nativelib, nscplugin, ... to 0.4.3 Revert "Fix tests to work with changes after scala#15569" This reverts commit 912b4f887912792202aa76e93fd19e63bd62f3bc.
Depends on #339 and #345.
Changes phases up to
Erasureto handleAnnotatedTypestransparently like their underlying type.In
Erasure, all type annotations are removed (AnnotatedTypesare replaced with their underlying). Without this, the backend blows up in various ways when it encounters anAnnotatedType.These changes are necessary and almost sufficient to make the current test suite pass if
Typer.adaptis modified to attach an annotation to the type of every tree whose typeisValueType.The remaining tests that fail when all such types are annotated are:
Cin methodfoo2has a period ofSyntheticMethods, butdenotis called on it from a context inFirstTransform.