-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #5720: don't output X <: Long in Java generic signatures #5816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nicolasstucki
merged 1 commit into
scala:master
from
dotty-staging:fix-5720-higher-kind-erasure
Jan 30, 2019
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,95 @@ | ||
// Ensure we omit valid JVM generic signatures when upper bounds are primitive | ||
// types. Java generic signatures cannot use primitive types in that position. | ||
|
||
class AUnit[B[_] <: Unit] | ||
class ABoolean[B[_] <: Boolean] | ||
|
||
class AByte[B[_] <: Byte] | ||
class AChar[B[_] <: Char] | ||
|
||
class AShort[B[_] <: Short] | ||
class AInt[B[_] <: Int] | ||
class ALong[B[_] <: Long] | ||
|
||
class AFloat[B[_] <: Float] | ||
class ADouble[B[_] <: Double] | ||
|
||
class ValClU(val i: Unit) extends AnyVal | ||
class AValClU[B[_] <: ValClU] | ||
class ValClI(val i: Int) extends AnyVal | ||
class AValClI[B[_] <: ValClI] | ||
|
||
package object opaquetypes { | ||
opaque type Logarithm = Double | ||
object Logarithm { | ||
class ALogarithm[B[_] <: Logarithm] | ||
type ALog = ALogarithm[[x] => Logarithm] | ||
type ALogD = ALogarithm[[x] => Double] | ||
type ALogN = ALogarithm[[x] => Nothing] | ||
|
||
type A1Log = opaquetypes.ALogarithm[[x] => Logarithm] | ||
// type A1LogD = opaquetypes.ALogarithm[[x] => Double] | ||
type A1LogN = opaquetypes.ALogarithm[[x] => Nothing] | ||
|
||
class ALogNested[B[_] <: Logarithm] | ||
class ValClLogNested(val i: Logarithm) extends AnyVal | ||
class AValClLogNested[B[_] <: ValClLogNested] | ||
|
||
type A = AValClLogNested[[x] => ValClLogNested] | ||
type AN = AValClLogNested[[x] => Nothing] | ||
} | ||
class ValClLog(val i: Logarithm) extends AnyVal | ||
class AValClLog[B[_] <: ValClLog] | ||
type AClLog = AValClLog[[x] => ValClLog] | ||
type AClLogN = AValClLog[[x] => Nothing] | ||
|
||
class ADouble[B[_] <: Double] | ||
type AD = ADouble[[x] => Double] | ||
type ADN = ADouble[[x] => Nothing] | ||
|
||
class ALogarithm[B[_] <: Logarithm] | ||
type ALog = ALogarithm[[x] => Logarithm] | ||
type ALogN = ALogarithm[[x] => Nothing] | ||
|
||
type A1Log = Logarithm.ALogarithm[[x] => Logarithm] | ||
type A1LogN = Logarithm.ALogarithm[[x] => Nothing] | ||
} | ||
|
||
object Main { | ||
type AU = AUnit[[x] => Unit] | ||
type AUN = AUnit[[x] => Nothing] | ||
|
||
type AB = ABoolean[[x] => Boolean] | ||
type ABN = ABoolean[[x] => Nothing] | ||
|
||
|
||
type ABy = AByte[[x] => Byte] | ||
type AByN = AByte[[x] => Nothing] | ||
|
||
type AC = AChar[[x] => Char] | ||
type ACN = AChar[[x] => Nothing] | ||
|
||
|
||
type AS = AShort[[x] => Short] | ||
type ASN = AShort[[x] => Nothing] | ||
|
||
type AI = AInt[[x] => Int] | ||
type AIN = AInt[[x] => Nothing] | ||
|
||
type AL = ALong[[x] => Long] | ||
type ALN = ALong[[x] => Nothing] | ||
|
||
|
||
type AF = AFloat[[x] => Float] | ||
type AFN = AFloat[[x] => Nothing] | ||
|
||
type AD = ADouble[[x] => Double] | ||
type ADN = ADouble[[x] => Nothing] | ||
|
||
|
||
type ACU = AValClU[[x] => ValClU] | ||
type ACUN = AValClU[[x] => Nothing] | ||
|
||
type ACI = AValClI[[x] => ValClI] | ||
type ACIN = AValClI[[x] => Nothing] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.