Skip to content

Fix #14667: Remove mangling of inner AnyQualifiedName's in fullNameSeparated #14749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ object SymDenotations {
if kind == FlatName && !encl.is(JavaDefined) then qn.compactified else qn
val fn = name replace {
case name: SimpleName => qualify(name)
case name @ AnyQualifiedName(_, _) => qualify(name.mangled.toSimpleName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact I now doubt whether we should have this case at all. If we remove this line, then #15702 succeeds. So if we can to this, it would be better.

case name @ AnyQualifiedName(_, _) => qualify(name.toSimpleName)
}
if (name.isTypeName) fn.toTypeName else fn.toTermName
}
Expand Down
2 changes: 2 additions & 0 deletions tests/run/i14667.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sigma
alpha beta gamma
16 changes: 16 additions & 0 deletions tests/run/i14667.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
trait A {
private val ? = "sigma"
def a = ?

val ?? = "alpha beta gamma"
def b = ??
}

class B extends A

object Test {
def main(args: Array[String]): Unit = {
println(new B().a)
println(new B().b)
}
}