blob: 45050ea7bc12d6e4ee9302f8a28998fc1c530adc [file] [log] [blame]
/*
* Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
*/
/**
* @assertion Mixin application semantics is mostly unchanged, except that it's
* a compile-time error to apply a mixin to a class that doesn't implement all
* the 'on' type requirements of the mixin declaration, or apply a mixin
* containing super-invocations to a class that doesn't have a concrete
* implementation of the super-invoked members compatible with the
* super-constraint interface.
*
* @description Checks that it is a compile error to apply a mixin to a class
* that doesn't implement all the 'on' type requirements of the mixin
* declaration.
* @compile-error
* @author ngl@unipro.ru
*/
class I {}
class J {}
abstract class B {
int get gi;
set si(int p);
int f();
}
class C {}
mixin M on B, C implements I, J {}
class MA1 with M {} //# 01: compile-time error
class MA2 with M { //# 02: compile-time error
int i = 1;
int get gi => i;
set si(int p) => i = p;
}
class MA3 with M { //# 03: compile-time error
int i = 1;
int get gi => i;
int f() => 1;
}
class MA4 with M { //# 04: compile-time error
int i = 1;
set si(int p) => i = p + 1;
int f() => 2;
}
main() {
}