- Notifications
You must be signed in to change notification settings - Fork3.1k
TASTy Reader: support Scala 3.4 [ci: last-only]#10670
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
19 commits Select commitHold shift + click to select a range
f0a484b prepare for syntax changes in Scala 3.4.0
bishaboshad3e7895 Upgrade tasty format, copy new tasty config
bishaboshaa565f9a enable pipelined compilation against Scala 3
bishabosha95900a6 support Java enum from TASTy
bishabosha9d37a96 support varargs and fields
bishaboshac09a900 support erasure of java arrays
bishaboshabd5b335 support Java fields
bishabosha0bd266c support java interfaces
bishabosha19ea949 support java annotations
bishaboshaabcb8ee add test for deprecation
bishabosha8cb3eff support inner class selection
bishabosha0cc7d73 workaround TASTy selection of inner class
bishaboshaa18de29 test parameterised types and bounds
bishaboshac00adb8 improved inner class selection
bishabosha6b2c4ae tweak symbolops error message
bishaboshae623261 deterministic loading of TASTy
bishaboshab0c8120 test annotations on types
bishaboshafa4c3df add filtering by jvm version in TastyTest
bishaboshabfed4df move isJava to Context
bishaboshaFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
improved inner class selection
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commitc00adb8790e2db0a88e0561fc182a2df1d103e7e
There are no files selected for viewing
27 changes: 19 additions & 8 deletionssrc/compiler/scala/tools/nsc/tasty/bridge/SymbolOps.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
21 changes: 12 additions & 9 deletionssrc/compiler/scala/tools/nsc/tasty/bridge/TypeOps.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletionssrc/tastytest/scala/tools/tastytest/Files.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletionssrc/tastytest/scala/tools/tastytest/SourceKind.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletionssrc/tastytest/scala/tools/tastytest/TastyTest.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletionstest/tasty/neg-move-macros/pre-a/Macros.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package tastytest | ||
| import scala.util.Random | ||
| import scala.reflect.macros.blackbox.Context | ||
| object Macros { | ||
| def posImpl(c: Context): c.Expr[Position] = { | ||
| import c.universe._ | ||
| val fileName = c.enclosingPosition.source.path.split('/').last | ||
| val line = c.enclosingPosition.line | ||
| c.Expr(q"new Position($fileName, $line)") | ||
| } | ||
| } |
16 changes: 0 additions & 16 deletionstest/tasty/neg-move-macros/pre-a/package.scala
This file was deleted.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
13 changes: 13 additions & 0 deletionstest/tasty/neg-move-macros/pre-b/Macros.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package tastytest | ||
| import scala.util.Random | ||
| // import scala.reflect.macros.blackbox.Context | ||
| object Macros { | ||
| // def posImpl(c: Context): c.Expr[Position] = { | ||
| // import c.universe._ | ||
| // val fileName = c.enclosingPosition.source.path.split('/').last | ||
| // val line = c.enclosingPosition.line | ||
| // c.Expr(q"new Position($fileName, $line)") | ||
| // } | ||
| } |
9 changes: 0 additions & 9 deletionstest/tasty/neg-move-macros/pre-b/package.scala
This file was deleted.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
2 changes: 1 addition & 1 deletiontest/tasty/neg-move-macros/src-2/TestMacroCompat.check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| TestMacroCompat_fail.scala:7: error: can't find term required by object tastytest.MacroCompat: tastytest.Macros.posImpl; perhaps it is missing from the classpath. | ||
| val result = MacroCompat.testCase("foo")(pos) | ||
| ^ | ||
| 1 error |
22 changes: 22 additions & 0 deletionstest/tasty/neg-pipelined/src-2/tastytest/TestRawTypes.check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| TestRawTypes_fail.scala:15: error: type mismatch; | ||
| found : lib.RawTypes#C[String]#D[String] | ||
| required: lib.RawTypes#C[T]#D[_] | ||
| Note: String <: Object, but Java-defined class D is invariant in type U. | ||
| You may wish to investigate a wildcard type such as `_ <: Object`. (SLS 3.2.10) | ||
| RawTypes.mii_Raw_Raw(cd_ii) // error | ||
| ^ | ||
| TestRawTypes_fail.scala:16: error: type mismatch; | ||
| found : lib.RawTypes#C[String]#D[String]#E[String] | ||
| required: lib.RawTypes#C[T]#D[U]#E[_] | ||
| Note: String <: Object, but Java-defined class E is invariant in type V. | ||
| You may wish to investigate a wildcard type such as `_ <: Object`. (SLS 3.2.10) | ||
| RawTypes.miii_Raw_Raw_Raw(cde_iii) // error | ||
| ^ | ||
| TestRawTypes_fail.scala:18: error: type mismatch; | ||
| found : lib.RawTypes.CStatic[String]#D[String] | ||
| required: lib.RawTypes.CStatic[T]#D[_] | ||
| Note: String <: Object, but Java-defined class D is invariant in type U. | ||
| You may wish to investigate a wildcard type such as `_ <: Object`. (SLS 3.2.10) | ||
| RawTypes.msi_Raw_Raw(cd_si) // error | ||
| ^ | ||
| 3 errors |
19 changes: 19 additions & 0 deletionstest/tasty/neg-pipelined/src-2/tastytest/TestRawTypes_fail.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package tastytest | ||
| import lib.RawTypes | ||
| object TestRawTypes extends scala.App { | ||
| val rt: RawTypes = new RawTypes() | ||
| val c: RawTypes#C[String] = new rt.C[String]() | ||
| val cd_ii: RawTypes#C[String]#D[String] = new c.D[String]() | ||
| val cde_iii: RawTypes#C[String]#D[String]#E[String] = new cd_ii.E[String]() | ||
| val c_s: RawTypes.CStatic[String] = new RawTypes.CStatic[String]() | ||
| val cd_si: RawTypes.CStatic[String]#D[String] = new c_s.D[String]() | ||
| RawTypes.mii_Raw_Raw(cd_ii) // error | ||
| RawTypes.miii_Raw_Raw_Raw(cde_iii) // error | ||
| RawTypes.msi_Raw_Raw(cd_si) // error | ||
| } |
38 changes: 38 additions & 0 deletionstest/tasty/neg-pipelined/src-3/lib/RawTypes.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package lib; | ||
| public class RawTypes { | ||
| public class C<T> { | ||
| public class D<U> { | ||
| public class E<V> {} | ||
| } | ||
| public static class DStatic<U> {} | ||
| } | ||
| public static class CStatic<T> { | ||
| public class D<U> {} | ||
| public static class DStatic<U> {} | ||
| } | ||
| public static void miii_Raw_Raw_Raw(C.D.E e) {} | ||
| public static void mii_Raw_Raw(C.D d) {} | ||
| public static void mis_Raw_Raw(C.DStatic d) {} | ||
| public static void msi_Raw_Raw(CStatic.D d) {} | ||
| public static void mss_Raw_Raw(CStatic.DStatic d) {} | ||
| // public static void mii_Raw_Gen(C.D<String> d) {} // illegal | ||
| public static void mis_Raw_Gen(C.DStatic<String> d) {} | ||
| // public static void msi_Raw_Gen(CStatic.D<String> d) {} // illegal | ||
| public static void mss_Raw_Gen(CStatic.DStatic<String> d) {} | ||
| // public static void mii_Gen_Raw(C<String>.D d) {} // illegal | ||
| // public static void mis_Gen_Raw(C<String>.DStatic d) {} // illegal | ||
| // public static void msi_Gen_Raw(CStatic<String>.D d) {} // illegal | ||
| // public static void mss_Gen_Raw(CStatic<String>.DStatic d) {} // illegal | ||
| public static void mii_Gen_Gen(C<String>.D<String> d) {} | ||
| // public static void mis_Gen_Gen(C<String>.DStatic<String> d) {} // illegal | ||
| public static void msi_Gen_Gen(CStatic<String>.D<String> d) {} | ||
| // public static void mss_Gen_Gen(CStatic<String>.DStatic<String> d) {} // illegal | ||
| } |
30 changes: 30 additions & 0 deletionstest/tasty/run-pipelined/src-2/tastytest/TestRawTypes.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package tastytest | ||
| import lib.RawTypes | ||
| object TestRawTypes extends scala.App { | ||
| val rt: RawTypes = new RawTypes() | ||
| val c: RawTypes#C[String] = new rt.C[String]() | ||
| val cd_ii: RawTypes#C[String]#D[String] = new c.D[String]() | ||
| val cde_iii: RawTypes#C[String]#D[String]#E[String] = new cd_ii.E[String]() | ||
| lazy val cd_is = new rt.C.DStatic[String]() // lazy because this fails at runtime even when reading from a classfile | ||
| val cd_s: RawTypes.CStatic[String] = new RawTypes.CStatic[String]() | ||
| val cd_si: RawTypes.CStatic[String]#D[String] = new cd_s.D[String]() | ||
| val cd_ss: RawTypes.CStatic.DStatic[String] = new RawTypes.CStatic.DStatic[String]() | ||
| // RawTypes.mii_Raw_Raw(cd_ii) // fails due to wildcards, see neg-pipelined for error message | ||
| // RawTypes.miii_Raw_Raw_Raw(cde_iii) // fails due to wildcards, see neg-pipelined for error message | ||
| RawTypes.mss_Raw_Raw(cd_ss) | ||
| def foo1 = RawTypes.mis_Raw_Raw(cd_is) // lazy because this fails at runtime even when reading from a classfile | ||
| RawTypes.mss_Raw_Gen(cd_ss) | ||
| def foo2 = RawTypes.mis_Raw_Gen(cd_is) // lazy because this fails at runtime even when reading from a classfile | ||
| RawTypes.mii_Gen_Gen(cd_ii) | ||
| RawTypes.msi_Gen_Gen(cd_si) | ||
| } |
38 changes: 38 additions & 0 deletionstest/tasty/run-pipelined/src-3/lib/RawTypes.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package lib; | ||
| public class RawTypes { | ||
| public class C<T> { | ||
| public class D<U> { | ||
| public class E<V> {} | ||
| } | ||
| public static class DStatic<U> {} | ||
| } | ||
| public static class CStatic<T> { | ||
| public class D<U> {} | ||
| public static class DStatic<U> {} | ||
| } | ||
| public static void miii_Raw_Raw_Raw(C.D.E e) {} | ||
| public static void mii_Raw_Raw(C.D d) {} | ||
| public static void mis_Raw_Raw(C.DStatic d) {} | ||
| public static void msi_Raw_Raw(CStatic.D d) {} | ||
| public static void mss_Raw_Raw(CStatic.DStatic d) {} | ||
| // public static void mii_Raw_Gen(C.D<String> d) {} // illegal | ||
| public static void mis_Raw_Gen(C.DStatic<String> d) {} | ||
| // public static void msi_Raw_Gen(CStatic.D<String> d) {} // illegal | ||
| public static void mss_Raw_Gen(CStatic.DStatic<String> d) {} | ||
| // public static void mii_Gen_Raw(C<String>.D d) {} // illegal | ||
| // public static void mis_Gen_Raw(C<String>.DStatic d) {} // illegal | ||
| // public static void msi_Gen_Raw(CStatic<String>.D d) {} // illegal | ||
| // public static void mss_Gen_Raw(CStatic<String>.DStatic d) {} // illegal | ||
| public static void mii_Gen_Gen(C<String>.D<String> d) {} | ||
| // public static void mis_Gen_Gen(C<String>.DStatic<String> d) {} // illegal | ||
| public static void msi_Gen_Gen(CStatic<String>.D<String> d) {} | ||
| // public static void mss_Gen_Gen(CStatic<String>.DStatic<String> d) {} // illegal | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.