Skip to content

Instantly share code, notes, and snippets.

View smarter's full-sized avatar

Guillaume Martres smarter

View GitHub Profile
@smarter
smarter / Meter-output.scala
Created May 23, 2015 21:00
Compiling Meter.scala with VC*Companion superclass
% javap -c Meter
Compiled from "Meter.scala"
public class Meter {
public static boolean canEqual(java.lang.Object);
Code:
0: getstatic #15 // Field Meter$.MODULE$:LMeter$;
3: aload_0
4: invokevirtual #17 // Method Meter$.canEqual:(Ljava/lang/Object;)Z
7: ireturn
class A extends java.lang.this#Object with scala.this#Any {
^inherited^ final def $asInstanceOf[ java.lang.Object.T0 >: scala.this#Nothing <: scala.this#Any](): <java.lang.Object.T0>
^inherited^ final def $isInstanceOf[ java.lang.Object.T0 >: scala.this#Nothing <: scala.this#Any](): scala.this#Boolean
^inherited^ final def synchronized[ java.lang.Object.T0 >: scala.this#Nothing <: scala.this#Any](x$1: <java.lang.Object.T0>): <java.lang.Object.T0>
^inherited^ final def ##(): scala.this#Int
^inherited^ final def !=(x$1: scala.this#Any): scala.this#Boolean
^inherited^ final def ==(x$1: scala.this#Any): scala.this#Boolean
^inherited^ final def ne(x$1: java.lang.this#Object): scala.this#Boolean
^inherited^ final def eq(x$1: java.lang.this#Object): scala.this#Boolean
^inherited^ @scala.this#throws[java.lang.this#Throwable]( = (classOf[java.lang.Throwable])) protected[java.lang] def finalize(): scala.this#Unit
exception occurred while typechecking try/i576b.scala
exception occurred while compiling try/i576b.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: non-existent getter denotation (val <none>) for getter(foo$default$1)
at scala.Predef$.assert(Predef.scala:165)
at dotty.tools.dotc.typer.Applications$Application.findGetter$1(Applications.scala:280)
at dotty.tools.dotc.typer.Applications$Application.findDefaultGetter(Applications.scala:284)
at dotty.tools.dotc.typer.Applications$Application.tryDefault$1(Applications.scala:327)
at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:358)
at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:192)
at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:434)
@smarter
smarter / i1103.crash
Created February 18, 2016 16:16
Infinite loop (stack-overflow) in subtyping when compiling Lucre
java.lang.StackOverflowError
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
[error] scala.MatchError: NoType$() (of class dotty.tools.dotc.core.Types$NoType$)
[error] at dotty.tools.dotc.core.SymDenotations$SymDenotation.sourceModule(SymDenotations.scala:782)
[error] at dotty.tools.dotc.core.SymDenotations$SymDenotation.scalacLinkedClass(SymDenotations.scala:914)
[error] at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readNewDef(TreeUnpickler.scala:600)
[error] at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readIndexedDef(TreeUnpickler.scala:546)
[error] at dotty.tools.dotc.core.tasty.TreeUnpickler$Completer.complete(TreeUnpickler.scala:91)
[error] at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:210)
[error] at dotty.tools.dotc.core.SymDenotations$SymDenotation.info(SymDenotations.scala:188)
[error] at dotty.tools.dotc.core.SymDenotations$ClassDenotation.membersNamed(SymDenotations.scala:1538)
[error] at dotty.tools.dotc.core.SymDenotations$ClassDenotation.findMember(SymDenotations.scala:1591)
cannot take signature of => B.this.Foo
exception while transforming () extends Object() with A {} of class class dotty.tools.dotc.ast.Trees$Template # 93
exception while transforming class B() extends Object() with A {} of class class dotty.tools.dotc.ast.Trees$TypeDef # 94
exception while transforming package <empty> {
<trait> trait A() extends Object {
private type Foo = Int
def foo: A.this.Foo = 1
}
class B() extends Object() with A {}
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 95
new files detected. rebuilding
[info] Loading global plugins from /home/smarter/.sbt/0.13/plugins
[info] Loading project definition from /home/smarter/opt/dotty/project
[info] Set current project to dotty (in build file:/home/smarter/opt/dotty/)
[warn] Multiple main classes detected. Run 'show discoveredMainClasses' to see the list
[warn] Multiple main classes detected. Run 'show discoveredMainClasses' to see the list
[info] Packaging /home/smarter/opt/dotty/target/scala-2.11/dotty_2.11-0.1-SNAPSHOT-tests.jar ...
[info] Done packaging.
[success] Total time: 1 s, completed 29 févr. 2016 19:55:18
/home/smarter/opt/dotty
exception while transforming () extends Object {
<accessor> def o(): Outer = new Outer()
<accessor> def inner(): Outer.this.Inner = {
final class $anon($outer: MustBeATrait) extends Outer.this.Inner(
this.MustBeATrait$~$anon$$$outer().o()
) {
private <accessor> def $outer(): MustBeATrait
final def MustBeATrait$~$anon$$$outer(): MustBeATrait = $outer()
}
new Outer.this.Inner{...}(this): Outer.this.Inner
abstract class A[T] {
object X {
def foo(x: T): T = x
}
}
object B extends A[Int] { // Change to String, fail as expected
}
abstract class A {
type T
object X {
def foo(x: T): T = x
}
}
object B extends A {
type T = Int // Change to String, should fail but doesn't
}