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

0.9.4 REPL no longer loads cats-core 0.9.0 #617

Closed
mpilquist opened this Issue May 30, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@mpilquist

mpilquist commented May 30, 2017

› amm
Loading...
Compiling <synthetic>/ammonite/predef/replBridge.sc
Compiling <synthetic>/ammonite/predef/interpBridge.sc
Compiling <synthetic>/ammonite/predef/DefaultPredef.sc
Welcome to the Ammonite Repl 0.9.4
(Scala 2.12.2 Java 1.8.0_112)
If you like Ammonite, please support our development at www.patreon.com/lihaoyi
@ import $ivy.`org.typelevel::cats-core:0.9.0`, cats._, cats.implicits._, cats.data._
https://repo1.maven.org/maven2/org/typelevel/cats-kernel_2.12/0.9.0/cats-kernel_2.12-0.9.0-sources.jar
  100.0% [##########] 32.5 KiB (147.5 KiB / s)
https://repo1.maven.org/maven2/org/typelevel/macro-compat_2.12/1.1.1/macro-compat_2.12-1.1.1-sources.jar
  100.0% [##########] 1.0 KiB (4.6 KiB / s)
https://repo1.maven.org/maven2/com/github/mpilquist/simulacrum_2.12/0.10.0/simulacrum_2.12-0.10.0-sources.jar
  100.0% [##########] 6.4 KiB (160.5 KiB / s)
https://repo1.maven.org/maven2/org/typelevel/machinist_2.12/0.6.1/machinist_2.12-0.6.1-sources.jar
  100.0% [##########] 3.5 KiB (84.5 KiB / s)
https://repo1.maven.org/maven2/org/typelevel/cats-macros_2.12/0.9.0/cats-macros_2.12-0.9.0-sources.jar
  100.0% [##########] 1.2 KiB (21.7 KiB / s)
https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.0/scala-reflect-2.12.0-sources.jar
  100.0% [##########] 557.8 KiB (1.6 MiB / s)
https://repo1.maven.org/maven2/org/typelevel/cats-core_2.12/0.9.0/cats-core_2.12-0.9.0-sources.jar
  100.0% [##########] 132.2 KiB (1.1 MiB / s)
https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1-sources.jar
  100.0% [##########] 965.4 KiB (3.7 MiB / s)
cmd0.sc:1: package cats contains object and package with same name: implicits
one of them needs to be removed from classpath
import $ivy.$                               , cats._, cats.implicits._, cats.data._
                                              ^
cmd0.sc:1: Symbol 'type <none>.instances.AllInstances' is missing from the classpath.
This symbol is required by 'object cats.implicits'.
Make sure that type AllInstances is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'implicits.class' was compiled against an incompatible version of <none>.instances.
import $ivy.$                               , cats._, cats.implicits._, cats.data._
                                                                        ^
Compilation Failed
@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented May 30, 2017

Thanks for the report! Will take a look

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented May 30, 2017

@mpilquist what if you put

interp.configureCompiler(_.settings.termConflict.value = "object")

before you do the import $ivy?

@mpilquist

This comment has been minimized.

mpilquist commented May 30, 2017

@lihaoyi That appears to fix it, at least with some trivial examples.

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented May 30, 2017

Sounds good. Let me know if there are further problems.

I'm guessing this is probably caused by the presence of source files on the classpath, within a folder of the same name as the package object. Somehow this causes the compiler to get confused because there is a package object, and there is also a "package" containing .scala resources of the same name.

From what I can tell, this setting is purely a "pick one instead of failing" thing, so I don't think it should cause any problems. I'll kick off a CI run to see if this setting causes any other breakage, if not I'll just turn it on by default.

Another solution would be to isolate the source jars from the classfile jars, which should definitely do the job if this doesn't work

@lihaoyi lihaoyi closed this May 30, 2017

@lihaoyi lihaoyi reopened this May 30, 2017

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented May 30, 2017

Pushed out 0.9.5 which fixes this

@lihaoyi lihaoyi closed this May 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment