forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scala#2215 from paulp/issue/7228
SI-7228, bug in subtyping.
- Loading branch information
Showing
10 changed files
with
128 additions
and
49 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
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 @@ | ||
-Xfatal-warnings |
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,75 @@ | ||
object AdaptWithWeaklyConformantType { | ||
implicit class D(d: Double) { def double = d*2 } | ||
|
||
val x1: Int = 1 | ||
var x2: Int = 2 | ||
val x3 = 3 | ||
var x4 = 4 | ||
final val x5 = 5 | ||
final var x6 = 6 | ||
|
||
def f1 = x1.double | ||
def f2 = x2.double | ||
def f3 = x3.double | ||
def f4 = x4.double | ||
def f5 = x5.double | ||
def f6 = x6.double | ||
} | ||
|
||
object AdaptAliasWithWeaklyConformantType { | ||
implicit class D(d: Double) { def double = d*2 } | ||
type T = Int | ||
|
||
val x1: T = 1 | ||
var x2: T = 2 | ||
val x3 = (3: T) | ||
var x4 = (4: T) | ||
final val x5 = (5: T) | ||
final var x6 = (6: T) | ||
|
||
def f1 = x1.double | ||
def f2 = x2.double | ||
def f3 = x3.double | ||
def f4 = x4.double | ||
def f5 = x5.double | ||
def f6 = x6.double | ||
} | ||
|
||
object AdaptToAliasWithWeaklyConformantType { | ||
type U = Double | ||
implicit class D(d: U) { def double = d*2 } | ||
|
||
val x1: Int = 1 | ||
var x2: Int = 2 | ||
val x3 = (3: Int) | ||
var x4 = (4: Int) | ||
final val x5 = (5: Int) | ||
final var x6 = (6: Int) | ||
|
||
def f1 = x1.double | ||
def f2 = x2.double | ||
def f3 = x3.double | ||
def f4 = x4.double | ||
def f5 = x5.double | ||
def f6 = x6.double | ||
} | ||
|
||
object AdaptAliasToAliasWithWeaklyConformantType { | ||
type U = Double | ||
type T = Int | ||
implicit class D(d: U) { def double = d*2 } | ||
|
||
val x1: T = 1 | ||
var x2: T = 2 | ||
val x3 = (3: T) | ||
var x4 = (4: T) | ||
final val x5 = (5: T) | ||
final var x6 = (6: T) | ||
|
||
def f1 = x1.double | ||
def f2 = x2.double | ||
def f3 = x3.double | ||
def f4 = x4.double | ||
def f5 = x5.double | ||
def f6 = x6.double | ||
} |
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 @@ | ||
-Xfatal-warnings |
File renamed without changes.