From c8bc92e1a1d2457b8b57ca55acc94357a285bdc5 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 10 Mar 2019 19:48:48 +0100 Subject: [PATCH] Fix #6054: Add missing dealias --- compiler/src/dotty/tools/dotc/ast/tpd.scala | 2 +- tests/pos/i6054.scala | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/pos/i6054.scala diff --git a/compiler/src/dotty/tools/dotc/ast/tpd.scala b/compiler/src/dotty/tools/dotc/ast/tpd.scala index cb6cedcf2e4a..9d786d21c44c 100644 --- a/compiler/src/dotty/tools/dotc/ast/tpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/tpd.scala @@ -435,7 +435,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { /** new C(args), calling the primary constructor of C */ def New(tp: Type, args: List[Tree])(implicit ctx: Context): Apply = - New(tp, tp.typeSymbol.primaryConstructor.asTerm, args) + New(tp, tp.dealias.typeSymbol.primaryConstructor.asTerm, args) /** new C(args), calling given constructor `constr` of C */ def New(tp: Type, constr: TermSymbol, args: List[Tree])(implicit ctx: Context): Apply = { diff --git a/tests/pos/i6054.scala b/tests/pos/i6054.scala new file mode 100644 index 000000000000..1c727d5283f9 --- /dev/null +++ b/tests/pos/i6054.scala @@ -0,0 +1,6 @@ +trait i0 { + trait i1 extends Throwable { false } +} +//trait i0 { +// trait I1 extends Throwable { val I1 = () } +//}