blob: 79450cd40c26bbbae6fdc9b98c2b04b987681e0c [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.
import "package:expect/expect.dart";
// A mixin declaration introduces a static scope.
// Instance members keep seeing this scope when mixed in.
abstract class UnaryNum {
num foo(num x);
mixin M1 on UnaryNum {
static int counter = 0;
static int next() => ++counter;
int count() => foo(next());
class C1 implements UnaryNum {
static int counter = 87;
static int next() => 42;
num foo(num x) => x * 10;
class A1 = C1 with M1;
main() {
Expect.equals(0, M1.counter);
var a = A1();
Expect.equals(30, a.count());
Expect.equals(40, a.count());