Skip to content

Commit 6224c1e

Browse files
committed
Revert "Survive untyped trees in eta expansion"
This reverts commit f61596b. A better fix is implemented in the next commit
1 parent 24c0ee6 commit 6224c1e

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
10041004
def sameTypes(trees: List[tpd.Tree], trees1: List[tpd.Tree]): Boolean = {
10051005
if (trees.isEmpty) trees.isEmpty
10061006
else if (trees1.isEmpty) trees.isEmpty
1007-
else (trees.head.typeOpt eq trees1.head.typeOpt) && sameTypes(trees.tail, trees1.tail)
1007+
else (trees.head.tpe eq trees1.head.tpe) && sameTypes(trees.tail, trees1.tail)
10081008
}
10091009

10101010
def evalOnce(tree: Tree)(within: Tree => Tree)(implicit ctx: Context) = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ abstract class Lifter {
4343
protected def liftedDef(sym: TermSymbol, rhs: Tree)(implicit ctx: Context): MemberDef = ValDef(sym, rhs)
4444

4545
private def lift(defs: mutable.ListBuffer[Tree], expr: Tree, prefix: TermName = EmptyTermName)(implicit ctx: Context): Tree =
46-
if (noLift(expr) || !expr.hasType && ctx.reporter.errorsReported) expr
46+
if (noLift(expr)) expr
4747
else {
4848
val name = UniqueName.fresh(prefix)
4949
var liftedType = fullyDefinedType(expr.tpe.widen, "lifted expression", expr.pos)

tests/neg/parser-stability-6.scala

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)