Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Thing
- class Creature extends Thing
- class Human extends Creature
- abstract class Two {
- def bi[A, B <: A](a: A, b: B): String
- def bis[A, B <: A](a: A, b: B): A
- }
- class Twos extends Two {
- // CORRECT
- def bi[Creature, Human](a: Creature, b: Human): String = { "asd" }
- //ERROR: class type required but Creature found
- def bis[Creature, Human](a: Creature, b: Human): Creature = { new Creature }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement