alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (t2071.scala)

This example Scala source code file (t2071.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

a, a, b, box, box, iterable, iterable, s, t, u, u

The Scala t2071.scala source code

/**
 * We still have to evaluate whether we will permit existentials
 * with cross type dependencies. My current reaction would be no.
 * Ticket stays open until a decision is made.
 */
trait Iterable[+S]
trait Box[U]

trait A {
 type T <: Iterable[S] forSome { type S <: Box[U]; type U }
}

trait B extends A {
 type T <: Iterable[S] forSome { type S <: Box[U]; type U }
}
/*
But according to SLS, 3.5.1 Type Equivalence: Two existential types (ยง3.2.10) are equivalent if they have the same number of quantifiers, and, after renaming one list of type quantifiers by another, the quantified types as well as lower and upper bounds of corresponding quantifiers are equivalent.

So, every existential type must be equivalent to (and conform to) itself.
Attachments
*/

Other Scala examples (source code examples)

Here is a short list of links related to this Scala t2071.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.