Chromium Code Reviews| Index: tests/language/mixin_invalid_bound_test.dart |
| =================================================================== |
| --- tests/language/mixin_invalid_bound_test.dart (revision 0) |
| +++ tests/language/mixin_invalid_bound_test.dart (revision 0) |
| @@ -0,0 +1,32 @@ |
| +// Copyright (c) 2014, 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. |
| + |
| +class S0<T> { } |
| + |
| +class S<T extends num> extends S0<String> { } |
| + |
| +class M<T extends num> { } |
| + |
| +class A<T extends num> extends S with M { } |
| + |
| +class B<T> extends S<T> with M<int> { } |
|
gbracha
2014/01/14 01:39:33
static type error in S<T> since T is not a subtype
regis
2014/01/14 18:40:45
Done.
|
| + |
| +class C<T> extends S<int> with M<T> { } |
| + |
| +class D<T> extends S<T> with M<bool> { } |
| + |
| +class E<T> extends S<bool> with M<T> { } |
| + |
| +main() { |
| + new A<int>(); /// 01: ok |
| + new A<bool>(); /// 02: static type warning, dynamic type error |
| + new B<int>(); /// 03: ok |
| + new B<bool>(); /// 04: static type warning, dynamic type error |
|
gbracha
2014/01/14 01:39:33
To be clear, the warning stems from the definition
regis
2014/01/14 18:40:45
Understood. Unfortunately, I do not see how to mak
|
| + new C<int>(); /// 05: ok |
| + new C<bool>(); /// 06: static type warning, dynamic type error |
|
gbracha
2014/01/14 01:39:33
as above. In fact, all the warnings are like this.
regis
2014/01/14 18:40:45
Agreed.
|
| + new D<int>(); /// 07: static type warning, dynamic type error |
| + new D<bool>(); /// 08: static type warning, dynamic type error |
| + new E<int>(); /// 09: static type warning, dynamic type error |
| + new E<bool>(); /// 10: static type warning, dynamic type error |
| +} |