-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix i11694: extract function type and SAM in union type
- Loading branch information
Showing
3 changed files
with
58 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
def test = { | ||
val x = new java.util.ArrayList[String]() | ||
val y = x.stream().nn.filter(s => s.nn.length > 0) | ||
} |
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,19 @@ | ||
def test1 = { | ||
def f11: (Int => Int) | Unit = x => x + 1 | ||
def f12: Null | (Int => Int) = x => x + 1 | ||
|
||
def f21: (Int => Int) | Null = x => x + 1 | ||
def f22: Null | (Int => Int) = x => x + 1 | ||
} | ||
|
||
def test2 = { | ||
def f1: (Int => String) | (Int => Int) | Null = x => x + 1 // error | ||
def f2: (Int => String) | Function[String, Int] | Null = x => "" + x // error | ||
def f3: Function[Int, Int] | Function[String, Int] | Null = x => x + 1 // error | ||
} | ||
|
||
def test3 = { | ||
import java.util.function.Function | ||
val f1: Function[String, Int] | Unit = x => x.length | ||
val f2: Function[String, Int] | Null = x => x.length | ||
} |