What are nested/unnested package in Scala 2.8?

Posted by retronym on Stack Overflow See other posts from Stack Overflow or by retronym
Published on 2010-05-13T20:55:37Z Indexed on 2010/05/13 21:44 UTC
Read the original article Hit count: 227

Filed under:
|
|

In Scala 2.7, I could write:

package com.acme.bar

class Bar

.

package com.acme.foo

class Foo {
  new bar.Bar
}

This doesn't compile in Scala 2.8 -- however this does:

package com.acme 
package bar

class Bar

.

package com.acme
package foo

class Foo {
  new bar.Bar
}
  1. What was the motivation for this?
  2. What is the precise meaning, with regards to scope and visibility?
  3. When should I use one form over the other?

© Stack Overflow or respective owner

Related posts about scala

Related posts about package