summaryrefslogtreecommitdiff
path: root/test/files/run/t7319.check
blob: 1dcb84c804b78d7308787df753c0db1939eda189 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
scala> class M[A]
defined class M

scala> implicit def ma0[A](a: A): M[A] = null
warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
ma0: [A](a: A)M[A]

scala> implicit def ma1[A](a: A): M[A] = null
warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
ma1: [A](a: A)M[A]

scala> def convert[F[X <: F[X]]](builder: F[_ <: F[_]]) = 0
warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
convert: [F[X <: F[X]]](builder: F[_ <: F[_]])Int

scala> convert(Some[Int](0))
<console>:15: error: no type parameters for method convert: (builder: F[_ <: F[_]])Int exist so that it can be applied to arguments (Some[Int])
 --- because ---
argument expression's type is not compatible with formal parameter type;
 found   : Some[Int]
 required: ?F[_$1] forSome { type _$1 <: ?F[_$2] forSome { type _$2 } }
       convert(Some[Int](0))
       ^
<console>:15: error: type mismatch;
 found   : Some[Int]
 required: F[_ <: F[_]]
       convert(Some[Int](0))
                        ^

scala> Range(1,2).toArray: Seq[_]
<console>:14: error: polymorphic expression cannot be instantiated to expected type;
 found   : [B >: Int]Array[B]
 required: Seq[_]
       Range(1,2).toArray: Seq[_]
                  ^

scala> 0
res2: Int = 0

scala> :quit