File tree 3 files changed +39
-0
lines changed 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ object HKGADT {
2
+ sealed trait Foo [F [_]]
3
+ final case class Bar () extends Foo [List ]
4
+
5
+ def frob [F [_]](foo : Foo [F ]) =
6
+ foo match {
7
+ case Bar () => ()
8
+ }
9
+ }
Original file line number Diff line number Diff line change
1
+ class C (val f : Any * )
2
+
3
+ class D (override val f : Nothing ) extends C (f)
Original file line number Diff line number Diff line change @@ -57,3 +57,30 @@ object overloaded {
57
57
val a : A = fr(new C )
58
58
val b : B = fr(new C )
59
59
}
60
+
61
+ // from #1381
62
+
63
+ object Foo {
64
+ class Bar [T ]
65
+ implicit def const [T ](x : T ): Bar [T ] = ???
66
+
67
+ def bar [T ](e : T ): Any = ???
68
+ def bar [T ](e : Bar [T ]): Any = ???
69
+
70
+ val b : Bar [Int ] = ???
71
+ bar(b)
72
+ }
73
+
74
+ object Test2 {
75
+ trait A ; trait B
76
+ class C1 {
77
+ def f (x : A ): Unit = println(" A" )
78
+ }
79
+ class C2 extends C1 {
80
+ def f (x : B ): Unit = println(" B" )
81
+ }
82
+ object Test extends C2 with App {
83
+ implicit def a2b (x : A ): B = new B {}
84
+ f(new A {})
85
+ }
86
+ }
You can’t perform that action at this time.
0 commit comments