Re: [scala-bts] (SI-9940) Incorrectly generated inner class name

Sett 33 ganger
Hopp til første uleste melding

Adriaan Moors

ulest,
30. sep. 2016, 11:15:0830.09.2016
til Aleksandar Prokopec (JIRA), adriaa...@typesafe.com
See also SI-9621 and SI-9938

On Thu, Sep 29, 2016 at 09:21 Aleksandar Prokopec (JIRA) <scala-i...@googlegroups.com> wrote:
Aleksandar Prokopec created an issue
 
Scala Programming Language / Bug SI-9940
Incorrectly generated inner class name
Issue Type: Bug Bug
Assignee: Lukas Rytz
Components: Compiler Backend
Created: 29/Sep/16 6:20 PM
Priority: Major Major
Reporter: Aleksandar Prokopec

1. This code:

class Buf {
  class ByteArray {
    object Owned
  }
}

object Buf {
  object ByteArray {
    object Owned
  }
}

results in the following error message:

test.scala:3: error: name clash: class Buf defines class ByteArray
and its companion object Buf also defines object ByteArray
  class ByteArray {
        ^
one error found

It seems like there should be no name clash.

2. This code:

object Buf {
  object ByteArray {
    object Owned
  }
}

generates a class Buf$ByteArray$Owned$. According to the JLS, and if a singleton object is a considered a class with a dollar appended, it should be Buf$$ByteArray$$Owned$.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4)
Atlassian logo
Svar alle
Svar til forfatter
Videresend
0 nye meldinger