Skip to content
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

Symbol names clash with nested classes #11848

Open
Atry opened this issue Jan 14, 2020 · 1 comment
Open

Symbol names clash with nested classes #11848

Atry opened this issue Jan 14, 2020 · 1 comment

Comments

@Atry
Copy link

@Atry Atry commented Jan 14, 2020

https://scastie.scala-lang.org/qQhetT2rQHOARFBbyXUYSw

object O extends App {
  object a_! {
    def foo = 1
  }
  
  object a_ {
    object bang {
      def foo = 2
    }
  }
  println(a_!.foo)
  println(a_.bang.foo)
}

Output:

2
2
@som-snytt

This comment has been minimized.

Copy link

@som-snytt som-snytt commented Jan 14, 2020

t11848.scala:7: warning: Generated class Main$a_$bang$ differs only in case from Main$a_$bang$.
  Such classes will overwrite one another on case-insensitive filesystems.
    object bang {
           ^

I was thinking it's just like names differing in case, but I didn't expect it to say that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.