File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
compiler/src/scala/quoted/runtime/impl Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import dotty.tools.dotc.core.Types.*
9
9
import dotty .tools .dotc .core .StdNames .nme
10
10
import dotty .tools .dotc .core .Symbols .*
11
11
import dotty .tools .dotc .util .optional
12
+ import dotty .tools .dotc .core .Types
13
+ import dotty .tools .dotc .core .Definitions
12
14
13
15
/** Matches a quoted tree against a quoted pattern tree.
14
16
* A quoted pattern tree may have type and term holes in addition to normal terms.
@@ -472,6 +474,24 @@ object QuoteMatcher {
472
474
*/
473
475
case OpenTree (tree : Tree , patternTpe : Type , args : List [Tree ], env : Env )
474
476
477
+ /** The Definitions object */
478
+ def defn (using Context ): Definitions = ctx.definitions
479
+
480
+ /*
481
+ * PR-17567 Remaining TODOs
482
+ * * [ ] Implicit / Contextual parameters
483
+ * * [ ] Nested Method Types
484
+ * * [ ] Erased Types
485
+ */
486
+ def adaptTypes (tpe : Type )(using Context ): Type =
487
+ new Types .TypeMap {
488
+ def apply (tp : Types .Type ): Types .Type = tp match
489
+ case tp : MethodType => {
490
+ return defn.FunctionOf (tp.paramInfos, tp.resultType)
491
+ }
492
+ case _ => mapOver(tp)
493
+ }.apply(tpe)
494
+
475
495
/** Return the expression that was extracted from a hole.
476
496
*
477
497
* If it was a closed expression it returns that expression. Otherwise,
You can’t perform that action at this time.
0 commit comments