Skip to content

Commit 5ea4daf

Browse files
committed
WIP: hotfix
1 parent 9830a3e commit 5ea4daf

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ 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+
val tg = withoutMode(Mode.ImplicitsEnabled)(typedExpr(arg))
113+
// println(i"tg = ${tg}")
114+
// println(i"ctx.mode = ${ctx.mode}")
115+
tg
113116
case arg =>
114117
report.error("Open pattern expected an identifier", arg.srcPos)
115118
EmptyTree

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4055,12 +4055,17 @@ 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))
4061-
case wtp: MethodType if wtp.isImplicitMethod &&
4066+
case wtp: MethodType if wtp.isImplicitMethod && ctx.mode.is(Mode.ImplicitsEnabled) &&
40624067
({ resMatch = constrainResult(tree.symbol, wtp, sharpenedPt); resMatch } || !functionExpected) =>
4063-
if (resMatch || ctx.mode.is(Mode.ImplicitsEnabled))
4068+
if (resMatch)
40644069
adaptNoArgsImplicitMethod(wtp)
40654070
else
40664071
// Don't proceed with implicit search if result type cannot match - the search

0 commit comments

Comments
 (0)