File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
compiler/src/dotty/tools/dotc/core/unpickleScala2 Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,10 @@ object Scala2Unpickler {
57
57
58
58
def addConstructorTypeParams (denot : SymDenotation )(implicit ctx : Context ): Unit = {
59
59
assert(denot.isConstructor)
60
- denot.info = PolyType .fromParams(denot.owner.typeParams, denot.info)
60
+ val typeParams = denot.owner.typeParams
61
+ denot.info = PolyType .fromParams(typeParams, denot.info)
62
+ if typeParams.nonEmpty then
63
+ denot.rawParamss = typeParams :: denot.rawParamss
61
64
}
62
65
63
66
/** Convert array parameters denoting a repeated parameter of a Java method
Original file line number Diff line number Diff line change
1
+
2
+ import scala .quoted .{Expr , QuoteContext }
3
+
4
+ object Inspect {
5
+ inline def inspect [T <: AnyKind ]: String = $ { inspectTpe[T ] }
6
+
7
+ def inspectTpe [T <: AnyKind ](using tpe : quoted.Type [T ], qctx0 : QuoteContext ): Expr [String ] = {
8
+ val tree = summon[quoted.Type [T ]].unseal.tpe.typeSymbol.tree
9
+ Expr (tree.show)
10
+ }
11
+ }
Original file line number Diff line number Diff line change
1
+ import Inspect ._
2
+
3
+ object Test extends App {
4
+ inspect[scala.collection.immutable.List [Int ]]
5
+ inspect[java.lang.String ]
6
+ inspect[String ]
7
+ inspect[List [Unit ]]
8
+ inspect[Some [Unit ]]
9
+ inspect[Tuple1 [Unit ]]
10
+ }
You can’t perform that action at this time.
0 commit comments