File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1975,8 +1975,8 @@ class Typer extends Namer
1975
1975
patBuf += pat1
1976
1976
}
1977
1977
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 {
1980
1980
case t : ExprType => t.resType
1981
1981
case t : MethodType => t.toFunctionType()
1982
1982
case t : PolyType =>
@@ -1985,9 +1985,9 @@ class Typer extends Namer
1985
1985
x => t.resType.subst(t, x).toFunctionType())
1986
1986
case t => t
1987
1987
}
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)
1991
1991
}
1992
1992
super .transform(tree)
1993
1993
case _ =>
You can’t perform that action at this time.
0 commit comments