mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:09:49 +00:00
2658f495f2
Change-Id: Ic30aef0302e1d2a2812eeb81b414a69e7591f625 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149622 Commit-Queue: Bob Nystrom <rnystrom@google.com> Reviewed-by: Nicholas Shahan <nshahan@google.com>
27 lines
634 B
Dart
27 lines
634 B
Dart
// 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";
|
|
|
|
// The `on` word is not a reserved word or built-in identifier.
|
|
// It's a purely contextual keyword.
|
|
// A type can have the name `on`, and even a mixin.
|
|
|
|
class A {}
|
|
|
|
mixin on on A {}
|
|
|
|
mixin M on on {}
|
|
|
|
mixin M2 implements on {}
|
|
|
|
class B = A with on;
|
|
class C = B with M;
|
|
class D = Object with M2;
|
|
|
|
main() {
|
|
Expect.type<on>(B());
|
|
Expect.type<on>(C());
|
|
Expect.type<on>(D());
|
|
} |