@@ -1914,26 +1914,10 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
19141914 .showing(i " desugared fun $tree --> $desugared with pt = $pt" , typr)
19151915 }
19161916
1917- /** Check that the PolyFunction doesn't have by-name parameters.
1918- * Return the unchanged tree if it's valid, or EmptyTree otherwise.
1919- */
1920- private def checkPolyTypeTree (tree : untpd.Tree )(using Context ): untpd.Tree =
1921- val untpd .PolyFunction (tparams : List [untpd.TypeDef ] @ unchecked, fun @ untpd.Function (vparamTypes, res)) = tree : @ unchecked
1922- var tree1 = tree
1923- vparamTypes.foreach:
1924- case t : ByNameTypeTree =>
1925- report.error(" By-name parameters are not supported in Polymorphic Functions" , t.srcPos)
1926- tree1 = untpd.EmptyTree
1927- case _ =>
1928- tree1
1929-
19301917 def typedPolyFunction (tree : untpd.PolyFunction , pt : Type )(using Context ): Tree =
19311918 val tree1 = desugar.normalizePolyFunction(tree)
1932- checkPolyTypeTree(tree1) match
1933- case tree2 : untpd.PolyFunction =>
1934- if (ctx.mode is Mode .Type ) typed(desugar.makePolyFunctionType(tree2), pt)
1935- else typedPolyFunctionValue(tree2, pt)
1936- case untpd.EmptyTree => TypeTree (NoType )
1919+ if (ctx.mode is Mode .Type ) typed(desugar.makePolyFunctionType(tree1), pt)
1920+ else typedPolyFunctionValue(tree1, pt)
19371921
19381922 def typedPolyFunctionValue (tree : untpd.PolyFunction , pt : Type )(using Context ): Tree =
19391923 val untpd .PolyFunction (tparams : List [untpd.TypeDef ] @ unchecked, fun) = tree : @ unchecked
0 commit comments