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

« back to all changes in this revision

Viewing changes to test/files/neg/any-vs-anyref.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
trait Quux extends Any
 
2
trait QuuxRef extends AnyRef
 
3
final class Bippy(val x: Any) extends AnyVal with Quux
 
4
 
 
5
object Foo {
 
6
  def foo1[A <: Product](a: A)                                      = { type X = a.type }
 
7
  def foo2[A <: Product with Quux](a: A)                            = { type X = a.type }
 
8
  def foo3(a: Product)                                              = { type X = a.type }
 
9
  def foo4(a: Product with Quux)                                    = { type X = a.type }
 
10
  def foo5(x: Quux with Product)                                    = (x eq "abc") && ("abc" eq x)
 
11
  def foo6(x: Quux with Product { def f: Int })                     = (x eq "abc") && ("abc" eq x)
 
12
  def foo7(x: Quux with Product { def eq(other: String): Boolean }) = (x eq "abc") && ("abc" eq x)
 
13
 
 
14
  def ok1[A <: QuuxRef](a: A)                            = { type X = a.type }
 
15
  def ok2[A <: Product with QuuxRef](a: A)               = { type X = a.type }
 
16
  def ok3(a: QuuxRef)                                    = { type X = a.type }
 
17
  def ok4(a: Product with QuuxRef)                       = { type X = a.type }
 
18
  def ok5(x: QuuxRef with Product)                       = (x eq "abc") && ("abc" eq x)
 
19
  def ok6(x: QuuxRef with Product { def f: Int })        = (x eq "abc") && ("abc" eq x)
 
20
  def ok7(x: QuuxRef { def eq(other: String): Boolean }) = (x eq "abc") && ("abc" eq x)
 
21
 
 
22
  def bad1(x: Bippy, y: Bippy) = x eq y
 
23
}
 
24
 
 
25
object Bar {
 
26
  def f(x: Quux { def g(x: Int): Int }): Int = x g 5
 
27
  f(new Quux { def g(x: String) = x })
 
28
  f(new Quux { def g(x: Int) = x })
 
29
}