-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).Dart language related items (some items might be better tracked at github.com/dart-lang/language).type-questionA question about expected behavior or functionalityA question about expected behavior or functionality
Description
It seems that if 2 mixins declare the same member with different bounds, the type of the latter mixin member must conform to the type first mixin member, which can throw an error even in cases where the class using the mixin is able to satisfy both types.
mixin LongRangeWeapon {}
mixin ExplosionWeapon {}
class Shotgun with LongRangeWeapon, ExplosionWeapon {}
mixin Shooter {
LongRangeWeapon get weapon;
}
mixin Bomber {
ExplosionWeapon get weapon;
}
abstract class Combatant with Shooter, Bomber { // 'Bomber.weapon' ('ExplosionWeapon Function()') isn't a valid override of 'Shooter.weapon' ('LongRangeWeapon Function()')
@override
Shotgun get weapon;
}expected behavior: There should not be any error as long as the class itself validly satisfies both mixin.
Metadata
Metadata
Assignees
Labels
area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).Dart language related items (some items might be better tracked at github.com/dart-lang/language).type-questionA question about expected behavior or functionalityA question about expected behavior or functionality