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

Can't instantiate an inner class in 2.12 version of Ammonite #515

Closed
lihaoyi opened this Issue Nov 29, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@lihaoyi
Owner

lihaoyi commented Nov 29, 2016

Welcome to the Ammonite Repl version-SNAPSHOT
(Scala 2.12.0 Java 1.8.0_112)
@ import $ivy.`org.pegdown:pegdown:1.6.0`
:: loading settings :: url = jar:file:/Users/lihaoyi/.coursier/cache/v1/https/repo1.maven.org/maven2/org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: org.pegdown#pegdown-caller;working
	confs: [default]
	found org.pegdown#pegdown;1.6.0 in central
	found org.parboiled#parboiled-java;1.1.7 in central
	found org.parboiled#parboiled-core;1.1.7 in central
	found org.ow2.asm#asm;5.0.3 in central
	found org.ow2.asm#asm-tree;5.0.3 in central
	found org.ow2.asm#asm-analysis;5.0.3 in central
	found org.ow2.asm#asm-util;5.0.3 in central
import $ivy.$
@ org.pegdown.ast.SimpleNode.Type.HRule
Class file for org.pegdown.ast.SimpleNode$Type not found
Compilation Failed

Seems to be a 2.12.0-specific problem, as 2.11.8 still works great. I bet something's still wrong with the classpath code again...

@lihaoyi lihaoyi added the bug label Nov 29, 2016

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Dec 6, 2016

Wonder if 2.12.1 fixes this

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Dec 6, 2016

bah still broken in 2.12.1

Welcome to the Ammonite Repl version-SNAPSHOT
(Scala 2.12.1 Java 1.8.0_112)
@ import $ivy.`org.pegdown:pegdown:1.6.0`
:: loading settings :: url = jar:file:/Users/lihaoyi/.coursier/cache/v1/https/repo1.maven.org/maven2/org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: org.pegdown#pegdown-caller;working
	confs: [default]
	found org.pegdown#pegdown;1.6.0 in central
	found org.parboiled#parboiled-java;1.1.7 in central
	found org.parboiled#parboiled-core;1.1.7 in central
	found org.ow2.asm#asm;5.0.3 in central
	found org.ow2.asm#asm-tree;5.0.3 in central
	found org.ow2.asm#asm-analysis;5.0.3 in central
	found org.ow2.asm#asm-util;5.0.3 in central
import $ivy.$
@ org.pegdown.ast.SimpleNode.Type.HRule
Class file for org.pegdown.ast.SimpleNode$Type not found
Compilation Failed

@lihaoyi lihaoyi changed the title from Pegdown broken in latest unstable build to Can't instantiate an inner class in 2.12 version Dec 8, 2016

@lihaoyi lihaoyi changed the title from Can't instantiate an inner class in 2.12 version to Can't instantiate an inner class in 2.12 version of Ammonite Dec 8, 2016

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Dec 8, 2016

This seems to be the case even without using import $ivy; you can add pegdown as a dependency to build.sbt and HRule still fails to compile with the same error. It's not clear to me why

@tkroman

This comment has been minimized.

Contributor

tkroman commented Dec 9, 2016

This may be related to the fact that this jar (evidently) has an unsatisfied dependency on parboiled (which isn't yet build for 2.12?), since the vanilla REPL does this:

⇒  scala -cp ~/.ivy2/cache/org.pegdown/pegdown/jars/pegdown-1.6.0.jar
Welcome to Scala 2.12.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_112).
Type in expressions for evaluation. Or try :help.

scala> val x = org.pegdown.ast.SimpleNode.Type.HRule
error: Class org.parboiled.trees.GraphNode not found - continuing with a stub.

scala> x
<console>:12: error: not found: value x
       x
       ^

scala> val x = org.pegdown.ast.SimpleNode.Type.HRule
x: org.pegdown.ast.SimpleNode.Type = HRule

WDYT? Should Ammonite attempt to do something like this?

@tkroman

This comment has been minimized.

Contributor

tkroman commented Dec 9, 2016

This also tells us that the issue has nothing to do with inner-ness of classes.

Well, actually, adding parboiled-core to vanilla REPL's classpath makes it work, not so much for amm. Will tinker a bit more.

tkroman added a commit to tkroman/Ammonite that referenced this issue Dec 10, 2016

@lihaoyi lihaoyi referenced this issue Dec 10, 2016

Merged

Fixed #515 #525

tkroman added a commit to tkroman/Ammonite that referenced this issue Dec 10, 2016

lihaoyi added a commit that referenced this issue Dec 10, 2016

@lihaoyi lihaoyi closed this in d32e120 Dec 10, 2016

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Dec 10, 2016

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