Skip to content

Commit fe04dae

Browse files
committed
Inhibit typer to insert contextual parameters into hoas pattern arguments
1 parent 9830a3e commit fe04dae

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ trait QuotesAndSplices {
109109
if (ctx.mode.is(Mode.QuotedPattern)) patternOuterContext(ctx.outer) else ctx
110110
val typedArgs = tree.args.map {
111111
case arg: untpd.Ident =>
112-
typedExpr(arg)
112+
withoutMode(Mode.ImplicitsEnabled)(typedExpr(arg))
113113
case arg =>
114114
report.error("Open pattern expected an identifier", arg.srcPos)
115115
EmptyTree

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4055,12 +4055,18 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
40554055
case _: SingletonType | _: FunOrPolyProto => false
40564056
case _ => true
40574057
var resMatch: Boolean = false
4058+
// println(i"adaptNoArgs: tree = ${tree}")
4059+
// println(i"adaptNoArgs: ctx.mode = ${ctx.mode}")
4060+
// println(i"adaptNoArgs: ptNorm = ${ptNorm}")
4061+
// println(i"functionExpected = ${functionExpected}")
4062+
// println(i"needsEta = ${needsEta}")
40584063
wtp match {
40594064
case wtp: ExprType =>
40604065
readaptSimplified(tree.withType(wtp.resultType))
40614066
case wtp: MethodType if wtp.isImplicitMethod &&
4067+
ctx.mode.is(Mode.ImplicitsEnabled) &&
40624068
({ resMatch = constrainResult(tree.symbol, wtp, sharpenedPt); resMatch } || !functionExpected) =>
4063-
if (resMatch || ctx.mode.is(Mode.ImplicitsEnabled))
4069+
if (resMatch)
40644070
adaptNoArgsImplicitMethod(wtp)
40654071
else
40664072
// Don't proceed with implicit search if result type cannot match - the search

0 commit comments

Comments
 (0)