File tree 5 files changed +17
-4
lines changed
compiler/src/dotty/tools/dotc
5 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -1725,7 +1725,7 @@ object Parsers {
1725
1725
case arg =>
1726
1726
arg
1727
1727
val args1 = args.mapConserve(sanitize)
1728
-
1728
+
1729
1729
if in.isArrow || isPureArrow || erasedArgs.contains(true ) then
1730
1730
functionRest(args)
1731
1731
else
Original file line number Diff line number Diff line change @@ -1131,7 +1131,7 @@ class Namer { typer: Typer =>
1131
1131
private def exportForwarders (exp : Export , pathMethod : Symbol )(using Context ): List [tpd.MemberDef ] =
1132
1132
val buf = new mutable.ListBuffer [tpd.MemberDef ]
1133
1133
val Export (expr, selectors) = exp
1134
- if expr.isEmpty then
1134
+ if expr.isEmpty || (selectors.size == 1 && selectors.exists(s => s.imported.name == nme. ERROR )) then
1135
1135
report.error(em " Export selector must have prefix and `.` " , exp.srcPos)
1136
1136
return Nil
1137
1137
Original file line number Diff line number Diff line change @@ -1977,8 +1977,6 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
1977
1977
// Polymorphic SAMs are not currently supported (#6904).
1978
1978
EmptyTree
1979
1979
case tp =>
1980
- if ! tp.isErroneous then
1981
- throw new java.lang.Error (i " internal error: closing over non-method $tp, pos = ${tree.span}" )
1982
1980
TypeTree (defn.AnyType )
1983
1981
}
1984
1982
else typed(tree.tpt)
Original file line number Diff line number Diff line change
1
+ package pakiet
2
+
3
+ def toppingPrice (size : Int ): Double = ???
4
+
5
+ def crustPrice (crustType : Double ): Double = ???
6
+
7
+ export toppingPrice .apply , crustPrice .unlift // error // error // error
Original file line number Diff line number Diff line change
1
+ package pakiet
2
+
3
+ def toppingPrice (size : Int ): Double = ???
4
+
5
+ def crustPrice (crustType : Double ): Double = ???
6
+
7
+ export toppingPrice , crustPrice // error // error
8
+ val i = 1 // error
You can’t perform that action at this time.
0 commit comments