File: t5340.scala

package info (click to toggle)
scala 2.11.8-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 61,060 kB
  • ctags: 3,923
  • sloc: java: 13,251; xml: 3,214; sh: 1,553; python: 756; makefile: 40; awk: 36; ansic: 6
file content (29 lines) | stat: -rw-r--r-- 683 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
class Poly {
  class E
  object E {
    implicit def conv(value: Any): E = sys.error("")
  }
}

object MyApp {
  val r: Poly = sys.error("")
  val s: Poly = sys.error("")
  val b: r.E = sys.error("")

  // okay
  s.E.conv(b): s.E

  // compilation fails with error below
  println(b: s.E)

  // amb prefix: MyApp.s.type#class E MyApp.r.type#class E
  // amb prefix: MyApp.s.type#class E MyApp.r.type#class E
  // ../test/pending/run/t5310.scala:17: error: type mismatch;
  //  found   : MyApp.r.E
  //  required: MyApp.s.E
  //   println(b: s.E)
  //           ^

  // The type error is as expected, but the `amb prefix` should be logged,
  // rather than printed to standard out.
}