Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
3 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,27 @@ | ||
class Sync | ||
|
||
class Async extends Sync { def x = 1 } | ||
|
||
trait Base { | ||
def foo: Sync | ||
} | ||
|
||
trait BaseSync extends Base { | ||
override def foo: Sync | ||
} | ||
|
||
trait BaseAsync extends Base { | ||
override def foo: Async | ||
} | ||
|
||
abstract class ImplAsync extends BaseAsync { | ||
final override def foo: Async = new Async | ||
} | ||
|
||
final class StrangeClass extends ImplAsync with BaseSync | ||
|
||
object Test { | ||
def main(args: Array[String]): Unit = { | ||
assert((new StrangeClass).foo.x == 1) | ||
} | ||
} |
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