This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usedNames: $anon,<init>,A,Any,B$,HasT,Int,Nothing,Object,T,X$,p,x | |
// topLevelDependencies: class A,class Any,class HasT,class Int,class Nothing,class Object,module class <empty>,module class B$ | |
// topLevelInheritanceDependencies: class A,class HasT,class Object | |
trait HasT extends java.lang.this#Object with scala.this#Any { | |
^inherited^ def wait(x$0: scala.this#Long, x$1: scala.this#Int): scala.this#Unit | |
^inherited^ def wait(x$0: scala.this#Long): scala.this#Unit | |
^inherited^ def wait(): scala.this#Unit | |
^inherited^ protected def finalize(): scala.this#Unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait HasT { type T } | |
abstract class A { | |
val p: HasT | |
object X { | |
def foo(x: p.T): p.T = x | |
} | |
} | |
object B extends A { | |
// compile, change Int to String, compile succeeds but shouldn't |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo[T] | |
class A extends Foo[Int] // compile, change Int to String, compile succeeds but shouldn't | |
object B { | |
val x: A = new A | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A0 | |
class A1 extends A0 // Compile, remove "extends A0", compile succeeds but shouldn't | |
object B { | |
val x: A1 = new A1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object A { | |
type T <: Int // Compile, change Int to String, compile succeeds but shouldn't | |
val x: T = null.asInstanceOf[T] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class A { | |
interface B {}; | |
public static <T extends A & B> T foo() { | |
return null; | |
} | |
public static void main(String[] args) { | |
B b = foo(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Test { | |
def foo[M[_]](x: M[Int]) = x | |
type Alias[A] = (A, A) | |
val x: Alias[Int] = (1, 2) | |
foo(x) // Infer M=Alias | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### Transcripts from failed tests ##### | |
# partest /home/smarter/opt/dotty/tests/partest-generated/pos/t1751 | |
% javac t1751/SuiteClasses.java | |
% javac -d /home/smarter/opt/dotty/tests/partest-generated/pos/t1751-pos.obj -classpath /home/smarter/opt/dotty/tests/partest-generated/pos/t1751-pos.obj /home/smarter/opt/dotty/tests/partest-generated/pos/t1751/SuiteClasses.java | |
% scalac t1751/A2_1.scala | |
compiling /home/smarter/opt/dotty/tests/partest-generated/pos/t1751/A2_1.scala | |
options: #runs 2 -pagewidth 160 -Yno-deep-subtypes -Yno-double-bindings -Yforce-sbt-phases -d ./tests/partest-generated/pos/t1751-pos.obj -Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef -classpath ./tests/partest-generated/pos/t1751-pos.obj | |
/home/smarter/opt/dotty/tests/partest-generated/pos/t1751/A2_1.scala:7: error: none of the overloaded alternatives of constructor SuiteClasses in class SuiteClasses with types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------- | |
123 | |
123 | |
1 | |
1 | |
Cons(1,Cons(2,Cons(3,Nil))) | |
Cons(2,Nil) | |
Cons(1,Cons(3,Nil)) | |
Cons(3,Nil) | |
Cons(true,Cons(true,Cons(true,Nil))) |