suddenly

We use 2.8

Now, in a piece of code that was not touched, the compiler says this:

Connection.scala:27: error: object Array is not a value
[INFO]       val child = new URLClassLoader(Array[URL](new File(path).toURI.toURL),getClass.getClassLoader)





I do not understand it, and I do not see an error either...




Thanks,
-Vlad

Re: suddenly

Sounds like you've introduced an import that binds the identifier to `Array` to a Java class, rather than `scala.Array`.
scala> String(1)<console>:8: error: object String is not a value               String(1)              ^
-jason
On Sat, Jan 14, 2012 at 12:02 AM, Vlad Patryshev <vpatryshev [at] gmail [dot] com> wrote:
We use 2.8

Now, in a piece of code that was not touched, the compiler says this:

Connection.scala:27: error: object Array is not a value
[INFO]       val child = new URLClassLoader(Array[URL](new File(path).toURI.toURL),getClass.getClassLoader)





I do not understand it, and I do not see an error either...




Thanks,
-Vlad

Re: suddenly

Thank you; seems like this is the case. Was fixed by using List(...).toArray.

Still, probably makes sense to file a bug; the message is pretty confusing.

Thanks,
-Vlad


On Fri, Jan 13, 2012 at 3:14 PM, Jason Zaugg <jzaugg [at] gmail [dot] com> wrote:
Sounds like you've introduced an import that binds the identifier to `Array` to a Java class, rather than `scala.Array`.
scala> String(1)<console>:8: error: object String is not a value               String(1)              ^
-jason
On Sat, Jan 14, 2012 at 12:02 AM, Vlad Patryshev <vpatryshev [at] gmail [dot] com> wrote:
We use 2.8

Now, in a piece of code that was not touched, the compiler says this:

Connection.scala:27: error: object Array is not a value
[INFO]       val child = new URLClassLoader(Array[URL](new File(path).toURI.toURL),getClass.getClassLoader)





I do not understand it, and I do not see an error either...




Thanks,
-Vlad


Re: suddenly

So, what happened.

First, we did not have an import of a class Array. But we had
import java.sql.{Connection,Driver... } - in total more than five classes listed.

So IntelliJ's scala plugin replaced it with java.sql._

and java.sql package has a class called Array.

=> Evil!

Thanks,
-Vlad


On Fri, Jan 13, 2012 at 3:21 PM, Vlad Patryshev <vpatryshev [at] gmail [dot] com> wrote:
Thank you; seems like this is the case. Was fixed by using List(...).toArray.

Still, probably makes sense to file a bug; the message is pretty confusing.

Thanks,
-Vlad


On Fri, Jan 13, 2012 at 3:14 PM, Jason Zaugg <jzaugg [at] gmail [dot] com> wrote:
Sounds like you've introduced an import that binds the identifier to `Array` to a Java class, rather than `scala.Array`.
scala> String(1)<console>:8: error: object String is not a value               String(1)              ^
-jason
On Sat, Jan 14, 2012 at 12:02 AM, Vlad Patryshev <vpatryshev [at] gmail [dot] com> wrote:
We use 2.8

Now, in a piece of code that was not touched, the compiler says this:

Connection.scala:27: error: object Array is not a value
[INFO]       val child = new URLClassLoader(Array[URL](new File(path).toURI.toURL),getClass.getClassLoader)





I do not understand it, and I do not see an error either...




Thanks,
-Vlad



Re: suddenly

On Sat, Jan 14, 2012 at 12:26 AM, Vlad Patryshev <vpatryshev [at] gmail [dot] com> wrote:
So, what happened.

First, we did not have an import of a class Array. But we had
import java.sql.{Connection,Driver... } - in total more than five classes listed.

So IntelliJ's scala plugin replaced it with java.sql._

and java.sql package has a class called Array.

=> Evil!

I've lodged a bug: http://youtrack.jetbrains.net/issues/SCL?q=import+scala#
In the meantime, you could set the threshold for switching to wildcard imports to a large number.
-jason 

RE: suddenly

It would be cool if scalac "knew" about certain Scala classes, like Map/Iterable/Array/Set etc etc and decided to fully-qualify such error messages that are involved in name clashes:
    "java.sql.Array is not a value"
I'll bet all of us have been puzzled many a time by similar wtf? errors
Chris

From: jzaugg [at] gmail [dot] com
Date: Sat, 14 Jan 2012 00:32:23 +0100
Subject: Re: [scala-user] suddenly
To: vpatryshev [at] gmail [dot] com
CC: scala-user [at] googlegroups [dot] com

On Sat, Jan 14, 2012 at 12:26 AM, Vlad Patryshev <vpatryshev [at] gmail [dot] com> wrote:
So, what happened.

First, we did not have an import of a class Array. But we had
import java.sql.{Connection,Driver... } - in total more than five classes listed.

So IntelliJ's scala plugin replaced it with java.sql._

and java.sql package has a class called Array.

=> Evil!

I've lodged a bug: http://youtrack.jetbrains.net/issues/SCL?q=import+scala#
In the meantime, you could set the threshold for switching to wildcard imports to a large number.
-jason 

Re: suddenly

Instead of going by special classes, the rule could be "any identifier that was shadowed by an import etc." should have its FQN in error messages.

On Sat, Jan 14, 2012 at 11:21 AM, Chris Marshall <oxbow_lakes [at] hotmail [dot] com> wrote:
It would be cool if scalac "knew" about certain Scala classes, like Map/Iterable/Array/Set etc etc and decided to fully-qualify such error messages that are involved in name clashes:
    "java.sql.Array is not a value"
I'll bet all of us have been puzzled many a time by similar wtf? errors
Chris

From: jzaugg [at] gmail [dot] com
Date: Sat, 14 Jan 2012 00:32:23 +0100
Subject: Re: [scala-user] suddenly
To: vpatryshev [at] gmail [dot] com
CC: scala-user [at] googlegroups [dot] com

On Sat, Jan 14, 2012 at 12:26 AM, Vlad Patryshev <vpatryshev [at] gmail [dot] com> wrote:
So, what happened.

First, we did not have an import of a class Array. But we had
import java.sql.{Connection,Driver... } - in total more than five classes listed.

So IntelliJ's scala plugin replaced it with java.sql._

and java.sql package has a class called Array.

=> Evil!

I've lodged a bug: http://youtrack.jetbrains.net/issues/SCL?q=import+scala#
In the meantime, you could set the threshold for switching to wildcard imports to a large number.
-jason 

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