~ubuntu-branches/debian/sid/scala/sid

« back to all changes in this revision

Viewing changes to test/files/run/existentials3-new.scala

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg, Mehdi Dogguy, Lucas Satabin, Frank S. Thomas, Emmanuel Bourg
  • Date: 2015-06-05 23:52:59 UTC
  • mfrom: (1.2.11)
  • Revision ID: package-import@ubuntu.com-20150605235259-wk00vgk83dh8o19g
Tags: 2.10.5-1
* Team upload.

[ Mehdi Dogguy ]
* New upstream release (Closes: #744278).

[ Lucas Satabin ]
* Update patches
* Update the clean target
* Update paths of elements to install
* Update watch file

[ Frank S. Thomas ]
* Remove myself from Uploaders.

[ Emmanuel Bourg ]
* The package has been adopted by the Java Team (Closes: #754935)
* Patched the build to avoid downloading libraries from the Internet
* Replaced the minified JavaScript files with unobfuscated ones
* No longer build scala-partest.jar until diffutils is packaged or replaced
* debian/watch: Fixed the versions matched (x.y.z instead of x.y.z..z)
* debian/rules:
  - Added the missing get-orig-source target (Closes: #724704)
  - Improved the clean target
* debian/control:
  - Build depend on scala (>= 2.10) and bnd
  - Use canonical URLs for the Vcs-* fields
  - Standards-Version updated to 3.9.6 (no changes)
* Switch to debhelper level 9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import scala.reflect.runtime.universe._
 
2
 
 
3
object Test {
 
4
  trait ToS { final override def toString = getClass.getName }
 
5
 
 
6
  def f1 = { case class Bar() extends ToS; Bar }
 
7
  def f2 = { case class Bar() extends ToS; Bar() }
 
8
  def f3 = { class Bar() extends ToS; object Bar extends ToS; Bar }
 
9
  def f4 = { class Bar() extends ToS; new Bar() }
 
10
  def f5 = { object Bar extends ToS; Bar }
 
11
  def f6 = { () => { object Bar extends ToS ; Bar } }
 
12
  def f7 = { val f = { () => { object Bar extends ToS ; Bar } } ; f }
 
13
 
 
14
  def f8 = { trait A ; trait B extends A ; class C extends B with ToS; new C { } }
 
15
  def f9 = { trait A ; trait B ; class C extends B with A with ToS; new C { } }
 
16
 
 
17
  def f10 = { class A { type T1 } ; List[A#T1]() }
 
18
  def f11 = { abstract class A extends Seq[Int] ; List[A]() }
 
19
  def f12 = { abstract class A extends Seq[U forSome { type U <: Int }] ; List[A]() }
 
20
 
 
21
  val g1 = { case class Bar() extends ToS; Bar }
 
22
  val g2 = { case class Bar() extends ToS; Bar() }
 
23
  val g3 = { class Bar() extends ToS; object Bar extends ToS; Bar }
 
24
  val g4 = { class Bar() extends ToS; new Bar() }
 
25
  val g5 = { object Bar extends ToS; Bar }
 
26
  val g6 = { () => { object Bar extends ToS ; Bar } }
 
27
  val g7 = { val f = { () => { object Bar extends ToS ; Bar } } ; f }
 
28
 
 
29
  val g8 = { trait A ; trait B extends A ; class C extends B with ToS; new C { } }
 
30
  val g9 = { trait A ; trait B ; class C extends B with A with ToS; new C { } }
 
31
 
 
32
  val g10 = { class A { type T1 } ; List[A#T1]() }
 
33
  val g11 = { abstract class A extends Seq[Int] ; List[A]() }
 
34
  val g12 = { abstract class A extends Seq[U forSome { type U <: Int }] ; List[A]() }
 
35
 
 
36
  def printTpe(t: Type) = {
 
37
    val s = if (t.typeSymbol.isFreeType) t.typeSymbol.typeSignature.toString else t.typeSymbol.toString
 
38
    println("%s, t=%s, s=%s".format(t, t.asInstanceOf[Product].productPrefix, s))
 
39
  }
 
40
  def m[T: TypeTag](x: T) = printTpe(typeOf[T])
 
41
  def m2[T: WeakTypeTag](x: T) = printTpe(implicitly[WeakTypeTag[T]].tpe)
 
42
 
 
43
  // tags do work for f10/g10
 
44
  def main(args: Array[String]): Unit = {
 
45
    m2(f1)
 
46
    m2(f2)
 
47
    m(f3)
 
48
    m(f4)
 
49
    m(f5)
 
50
    m(f6)
 
51
    m(f7)
 
52
    m2(f8)
 
53
    m2(f9)
 
54
    m2(f10)
 
55
    m(f11)
 
56
    m(f12)
 
57
    m2(g1)
 
58
    m2(g2)
 
59
    m(g3)
 
60
    m(g4)
 
61
    m(g5)
 
62
    m(g6)
 
63
    m(g7)
 
64
    m2(g8)
 
65
    m2(g9)
 
66
    m2(g10)
 
67
    m(g11)
 
68
    m(g12)
 
69
  }
 
70
}
 
71
 
 
72
object Misc {
 
73
  trait Bippy { def bippy = "I'm Bippy!" }
 
74
  object o1 {
 
75
    def f1 = { trait A extends Seq[U forSome { type U <: Bippy }] ; abstract class B extends A ; trait C extends B ; (null: C) }
 
76
    def f2 = f1.head.bippy
 
77
  }
 
78
  def g1 = o1.f1 _
 
79
  def g2 = o1.f2 _
 
80
}
 
 
b'\\ No newline at end of file'