-
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.
Merge pull request #11926 from dotty-staging/fix-11922
Eta expand exported type constructors
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
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,17 @@ | ||
object example { | ||
trait MyType[A] | ||
type Alias[A, B] = MyType[B] | ||
} | ||
|
||
object bug { | ||
export example.{MyType, Alias} | ||
def bug[A](m: MyType[A]): MyType[A] = m | ||
val bug2: MyType[String] => MyType[String] = m => m | ||
def bug3[A, B](m: Alias[A, B]): MyType[B] = m | ||
def bug4[A, B](m: Alias[A, B]): Alias[Int, B] = m | ||
|
||
//it works when referencing the original type in the parameter position. | ||
def thisWorks[A](m: example.MyType[A]): MyType[A] = m | ||
val thisWorks2: example.MyType[String] => MyType[String] = m => m | ||
val thisWorks3: MyType[String] = (??? : MyType[String]) | ||
} |