mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 21:11:19 +00:00
c646aed258
Implment the class X = S with M syntax, add warning on deprecated typedef syntax. Also convert a handful of tests. More tests to be converted subsequently. R=regis@google.com Review URL: https://codereview.chromium.org//27223005 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28652 260f80e4-7a28-3924-810f-c04153c831b5
53 lines
1.1 KiB
Dart
53 lines
1.1 KiB
Dart
// Copyright (c) 2013, 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.
|
|
|
|
// Check mixin of black-listed types.
|
|
|
|
import 'package:expect/expect.dart';
|
|
|
|
class C {}
|
|
class D {}
|
|
|
|
class C1 extends Object
|
|
with String /// 01: compile-time error
|
|
{}
|
|
|
|
class D1 extends Object with C
|
|
, Null /// 02: compile-time error
|
|
{}
|
|
|
|
class E1 extends Object with
|
|
int, /// 03: compile-time error
|
|
C {}
|
|
|
|
class F1 extends Object with C
|
|
, double /// 04: compile-time error
|
|
, D {}
|
|
|
|
class C2 = Object with num; /// 05: compile-time error
|
|
|
|
class D2 = Object with C
|
|
, bool /// 06: compile-time error
|
|
;
|
|
|
|
class E2 = Object with
|
|
String, /// 07: compile-time error
|
|
C;
|
|
|
|
class F2 = Object with C,
|
|
dynamic, /// 08: compile-time error
|
|
D;
|
|
|
|
|
|
main() {
|
|
Expect.isNotNull(new C1());
|
|
Expect.isNotNull(new D1());
|
|
Expect.isNotNull(new E1());
|
|
Expect.isNotNull(new F1());
|
|
Expect.isNotNull(new C2()); /// 05: continued
|
|
Expect.isNotNull(new D2());
|
|
Expect.isNotNull(new E2());
|
|
Expect.isNotNull(new F2());
|
|
}
|