File: t1195-new.scala

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 (30 lines) | stat: -rw-r--r-- 588 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

import scala.language.{ existentials }
import scala.reflect.runtime.universe._

object Test {
  def f() = { case class Bar(x: Int); Bar }
  def g() = { case class Bar(x: Int); Bar(5) }
  def h() = { case object Bar ; Bar }

  val f1 = f()
  val g1 = g()
  val h1 = h()

  def m[T: WeakTypeTag](x: T) = println(weakTypeOf[T] + ", underlying = " + weakTypeOf[T].typeSymbol.info)

  def main(args: Array[String]): Unit = {
    m(f)
    m(g)
    m(h)
    m(f1)
    m(g1)
    m(h1)
  }
}

class A1[T] {
  class B1[U] {
    def f = { case class D(x: Int) extends A1[String] ; new D(5) }
  }
}