This page is no longer maintained — Please continue to the home page at www.scala-lang.org

What are unnested packages?

1 reply
Ilya Sergey
Joined: 2009-02-02,
User offline. Last seen 42 years 45 weeks ago.
Hi all.

As I noticed by the broken CI build there was a huge commit on 24th of July, which brought unnested packages to Scala. It seems, I missed something important. What is the point an semantics of these changes?

With best regards,
Ilya
Ricky Clarkson
Joined: 2008-12-19,
User offline. Last seen 3 years 2 weeks ago.
Re: What are unnested packages?

Before that commit:

package my.scala.stuff

Here, scala.List(3,4,5) looks for my.scala.List(3,4,5), and gives a
compile error.

After that commit:

package my.scala.stuff

Here, scala.List(3,4,5) gets _root_.scala.List, and works fine.

Suppose I _want_ scala.List to be my.scala.List:

package my
package scala.stuff

Here, scala.List(3,4,5) looks for my.scala.List(3,4,5).

A large recent thread on imports in the scala-user thread gives some
background. I expect someone else is typing a better explanation up.

2009/7/29 Ilya Sergey :
> Hi all.
>
> As I noticed by the broken CI build there was a huge commit on 24th of July,
> which brought unnested packages to Scala. It seems, I missed something
> important. What is the point an semantics of these changes?
>
> With best regards,
> Ilya
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland