Skip to content

Commit 4732288

Browse files
committed
Use scala.reflect.TypeTest
3 unsoundess issues found by TypeTest in the reflection API marked with FIXME.
1 parent 0c5678d commit 4732288

File tree

9 files changed

+192
-299
lines changed

9 files changed

+192
-299
lines changed

compiler/src/scala/quoted/internal/impl/QuoteContextImpl.scala

Lines changed: 189 additions & 283 deletions
Large diffs are not rendered by default.

library/src/scala/quoted/Reflection.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package scala.quoted
22

3-
import scala.tasty.reflect._
3+
import scala.reflect.TypeTest
44

55
/** AST reflection interface.
66
*

library/src/scala/quoted/internal/QuoteMatching.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package scala.quoted.internal
22

33
import scala.quoted.{QuoteContext, Expr, Type}
4-
import scala.tasty.reflect._
54

65
/** Part of the QuoteContext interface that needs to be implemented by the compiler but is not visible to users */
76
trait QuoteMatching { self: QuoteContext & QuoteUnpickler =>

library/src/scala/quoted/internal/QuoteUnpickler.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package scala.quoted.internal
22

33
import scala.quoted.{QuoteContext, Expr, Type}
4-
import scala.tasty.reflect._
54

65
/** Part of the QuoteContext interface that needs to be implemented by the compiler but is not visible to users */
76
trait QuoteUnpickler { self: QuoteContext & QuoteMatching =>

library/src/scala/tasty/reflect/TypeTest.scala

Lines changed: 0 additions & 9 deletions
This file was deleted.

scala3doc/src/dotty/dokka/tasty/ScalaDocSupport.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package dotty.dokka.tasty
22

33
import scala.jdk.CollectionConverters._
4-
import scala.tasty.reflect._
54

65
import org.jetbrains.dokka.model.{doc => dkkd}
76

scala3doc/src/dotty/dokka/tasty/TypesSupport.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ trait TypesSupport:
242242
}
243243
inner(sc) ++ texts(" match {\n") ++ casesTexts ++ texts("}")
244244

245-
case TypeIdent(t) => texts(t)
245+
// TODO: Unreachable. TypeIdent is a TypeTree and not a TypeRep. Should this be cover in antother way?
246+
// case TypeIdent(t) => texts(t)
246247

247248
case ParamRef(TypeLambda(names, _, _), i) => texts(names.apply(i))
248249

tests/pos-macros/i9240/Macro_1.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import scala.quoted._
2-
import scala.tasty._
32

43
inline def diveInto[T]: String = ${ diveIntoImpl[T]() }
54

tests/run-macros/tasty-construct-types/Macro_1.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import tasty._
21
import quoted._
32

43
object Macros {

0 commit comments

Comments
 (0)