File: no-implicit-to-anyref-any-val.check

package info (click to toggle)
scala 2.11.12-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 62,924 kB
  • sloc: javascript: 28,808; java: 13,415; xml: 3,135; sh: 1,620; python: 756; makefile: 38; awk: 36; ansic: 6
file content (34 lines) | stat: -rw-r--r-- 1,250 bytes parent folder | download | duplicates (4)
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
no-implicit-to-anyref-any-val.scala:11: error: the result type of an implicit conversion must be more specific than AnyRef
    1: AnyRef
    ^
no-implicit-to-anyref-any-val.scala:17: error: type mismatch;
 found   : Any
 required: AnyRef
    (null: Any): AnyRef
         ^
no-implicit-to-anyref-any-val.scala:21: error: type mismatch;
 found   : AnyVal
 required: AnyRef
    (0: AnyVal): AnyRef
      ^
no-implicit-to-anyref-any-val.scala:27: error: type mismatch;
 found   : Test.AV
 required: AnyRef
Note that AV extends Any, not AnyRef.
Such types can participate in value classes, but instances
cannot appear in singleton types or in reference comparisons.
    new AV(0): AnyRef
    ^
no-implicit-to-anyref-any-val.scala:30: error: the result type of an implicit conversion must be more specific than AnyVal
  "": AnyVal
  ^
no-implicit-to-anyref-any-val.scala:32: error: type mismatch;
 found   : Object
 required: AnyVal
Note that implicit conversions are not applicable because they are ambiguous:
 both method ArrowAssoc in object Predef of type [A](self: A)ArrowAssoc[A]
 and method Ensuring in object Predef of type [A](self: A)Ensuring[A]
 are possible conversion functions from Object to AnyVal
  new Object() : AnyVal
  ^
6 errors found