File tree 2 files changed +4
-7
lines changed
compiler/src/dotty/tools/dotc
2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1765,12 +1765,8 @@ object Parsers {
1765
1765
TypeTree () // XX-METHOD-INFER
1766
1766
} else {
1767
1767
accept(COLON )
1768
- if (in.token == ARROW ) {
1769
- if (owner.isTypeName && ! (mods is Local ))
1770
- syntaxError(s " ${if (mods is Mutable ) " `var'" else " `val'" } parameters may not be call-by-name " )
1771
- else if (imods.hasFlags)
1772
- syntaxError(" implicit parameters may not be call-by-name" )
1773
- }
1768
+ if (in.token == ARROW && owner.isTypeName && ! (mods is Local ))
1769
+ syntaxError(s " ${if (mods is Mutable ) " `var'" else " `val'" } parameters may not be call-by-name " )
1774
1770
paramType()
1775
1771
}
1776
1772
val default =
Original file line number Diff line number Diff line change @@ -1880,7 +1880,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1880
1880
val args = (wtp.paramNames, wtp.paramTypes).zipped map { (pname, formal) =>
1881
1881
def implicitArgError (msg : String => String ) =
1882
1882
errors += (() => msg(em " parameter $pname of $methodStr" ))
1883
- inferImplicitArg(formal, implicitArgError, tree.pos.endPos)
1883
+ if (errors.nonEmpty) EmptyTree
1884
+ else inferImplicitArg(formal.widenExpr, implicitArgError, tree.pos.endPos)
1884
1885
}
1885
1886
if (errors.nonEmpty) {
1886
1887
// If there are several arguments, some arguments might already
You can’t perform that action at this time.
0 commit comments