From fb5f38098b540a721425d61ca9fbcebc885238b8 Mon Sep 17 00:00:00 2001 From: odersky Date: Mon, 18 Apr 2022 15:05:07 +0200 Subject: [PATCH] Adapt infos of export default getters to qualifier Fixes #14953 --- compiler/src/dotty/tools/dotc/typer/Namer.scala | 3 ++- tests/pos/i14953.scala | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/pos/i14953.scala diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index aac0288aa771..2b85d442e959 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -1185,7 +1185,8 @@ class Namer { typer: Typer => buf += ddef.withSpan(span) if hasDefaults then foreachDefaultGetterOf(sym.asTerm, - getter => addForwarder(getter.name.asTermName, getter, span)) + getter => addForwarder( + getter.name.asTermName, getter.asSeenFrom(path.tpe), span)) end addForwarder def addForwardersNamed(name: TermName, alias: TermName, span: Span): Unit = diff --git a/tests/pos/i14953.scala b/tests/pos/i14953.scala new file mode 100644 index 000000000000..6448f74cd4ab --- /dev/null +++ b/tests/pos/i14953.scala @@ -0,0 +1,8 @@ +object Test{ + + val xs: Seq[String] = List("Apple", "Orange", "Pear") + export xs.* + +} + +val _ = Test.head