Skip to content

Commit cf5f6f1

Browse files
committed
Cleanup code
1 parent 87f7d52 commit cf5f6f1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,8 +1975,8 @@ class Typer extends Namer
19751975
patBuf += pat1
19761976
}
19771977
case ddef: ValOrDefDef =>
1978-
if (ddef.symbol.annotations.exists(_.symbol == defn.InternalQuoted_patternBindHoleAnnot)) {
1979-
val tpe = ddef.symbol.info match {
1978+
if (ddef.symbol.hasAnnotation(defn.InternalQuoted_patternBindHoleAnnot)) {
1979+
val bindingType = ddef.symbol.info match {
19801980
case t: ExprType => t.resType
19811981
case t: MethodType => t.toFunctionType()
19821982
case t: PolyType =>
@@ -1985,9 +1985,9 @@ class Typer extends Namer
19851985
x => t.resType.subst(t, x).toFunctionType())
19861986
case t => t
19871987
}
1988-
val exprTpe = AppliedType(defn.QuotedMatchingBindingType, tpe :: Nil)
1989-
val sym = ctx0.newPatternBoundSymbol(ddef.name, exprTpe, ddef.span)
1990-
patBuf += Bind(sym, untpd.Ident(nme.WILDCARD).withType(exprTpe)).withSpan(ddef.span)
1988+
val bindingExprTpe = AppliedType(defn.QuotedMatchingBindingType, bindingType :: Nil)
1989+
val sym = ctx0.newPatternBoundSymbol(ddef.name, bindingExprTpe, ddef.span)
1990+
patBuf += Bind(sym, untpd.Ident(nme.WILDCARD).withType(bindingExprTpe)).withSpan(ddef.span)
19911991
}
19921992
super.transform(tree)
19931993
case _ =>

0 commit comments

Comments
 (0)