-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SI-5703: normalize refined types more
to improve Array[T] java-interop with T[], normalize Object with Object{} to Object fix #SI-5688 by flattening refined types in parents updated check files to reflect flattening of refined types and updated position for refined types
- Loading branch information
Showing
10 changed files
with
86 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
override.scala:9: error: overriding type T in trait A with bounds >: Int <: Int; | ||
type T in trait B with bounds >: String <: String has incompatible type | ||
lazy val x : A with B = x | ||
^ | ||
^ | ||
one error found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
public abstract class Base<Params> { | ||
public abstract void func(Params[] params); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Implementation extends Base[Object] { | ||
def func(params: Array[Object]): Unit = {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object | ||
_ <: Object with Test$ToS with scala.Product with scala.Serializable | ||
Object with Test$ToS | ||
Object with Test$ToS | ||
Object with Test$ToS | ||
scala.Function0[Object with Test$ToS] | ||
scala.Function0[Object with Test$ToS] | ||
_ <: Object with _ <: Object with Object with Test$ToS | ||
_ <: Object with _ <: Object with _ <: Object with Test$ToS | ||
scala.collection.immutable.List[Object with scala.collection.Seq[Int]] | ||
scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]] | ||
_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object | ||
_ <: Object with Test$ToS with scala.Product with scala.Serializable | ||
Object with Test$ToS | ||
Object with Test$ToS | ||
Object with Test$ToS | ||
scala.Function0[Object with Test$ToS] | ||
scala.Function0[Object with Test$ToS] | ||
_ <: Object with _ <: Object with Object with Test$ToS | ||
_ <: Object with _ <: Object with _ <: Object with Test$ToS | ||
scala.collection.immutable.List[Object with scala.collection.Seq[Int]] | ||
scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]] | ||
_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object | ||
_ <: Object with Test$ToS with scala.Product with scala.Serializable | ||
Object with Test$ToS | ||
Object with Test$ToS | ||
Object with Test$ToS | ||
scala.Function0[Object with Test$ToS] | ||
scala.Function0[Object with Test$ToS] | ||
_ <: Object with _ <: Object with Test$ToS | ||
_ <: Object with _ <: Object with _ <: Object with Test$ToS | ||
scala.collection.immutable.List[Object with scala.collection.Seq[Int]] | ||
scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]] | ||
_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object | ||
_ <: Object with Test$ToS with scala.Product with scala.Serializable | ||
Object with Test$ToS | ||
Object with Test$ToS | ||
Object with Test$ToS | ||
scala.Function0[Object with Test$ToS] | ||
scala.Function0[Object with Test$ToS] | ||
_ <: Object with _ <: Object with Test$ToS | ||
_ <: Object with _ <: Object with _ <: Object with Test$ToS | ||
scala.collection.immutable.List[Object with scala.collection.Seq[Int]] | ||
scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Vector(ta, tb, tab) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
object Test extends App { | ||
trait T | ||
|
||
trait TA | ||
trait TB | ||
|
||
class A extends T with TA | ||
class B extends T with TB | ||
class AB extends T with TA with TB | ||
// Matching on _: TA with TB | ||
|
||
val li: Vector[T] = Vector(new A, new B, new AB) | ||
|
||
val matched = (for (l <- li) yield { | ||
l match { | ||
case _: TA with TB => "tab" | ||
case _: TA => "ta" | ||
case _: TB => "tb" | ||
} | ||
}) | ||
|
||
println(matched) | ||
} |