Skip to content

Commit c3da6de

Browse files
author
Sergey G. Grekhov
committed
Fix for issue #129. Wrong test is separated to two ones. One should pass, the second should fail with the compile time error
1 parent dce29c6 commit c3da6de

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

Language/Classes/definition_t23.dart

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
* @description Checks that various class definitions that are valid according
1313
* to 'metadata abstract? class mixinApplicationClass' syntax do not cause any
1414
* errors and can be instantiated.
15-
* @author golovleva
15+
16+
17+
* @issue dart-lang/co19#129
1618
*/
1719

1820
@A() abstract class I1<T> = A1 with B1;
@@ -25,16 +27,9 @@ abstract class J2 = A1 with B1;
2527
@B() class X2 = A1 with B1;
2628
class Y2 = A1 with B1;
2729

28-
@A() abstract class I3<T> = A1 with B1 implements A1;
29-
abstract class J3<T> = A1 with B1 implements A1;
3030
@B() class X3<T> = B1 with A1 implements A1;
3131
class Y3<T> = B1 with A1 implements A1;
3232

33-
@A() abstract class I4 = A1 with B1 implements A1;
34-
abstract class J4 = A1 with B1 implements A1;
35-
@B() class X4 = A1 with B1 implements A1;
36-
class Y4 = A1 with B1 implements A1;
37-
3833
abstract class A1 {}
3934
class B1 {}
4035

@@ -56,7 +51,4 @@ main() {
5651

5752
X3 x3 = new X3();
5853
Y3 y3 = new Y3();
59-
60-
X4 x4 = new X4();
61-
Y4 y4 = new Y4();
6254
}

Language/Classes/definition_t24.dart

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3+
* for details. All rights reserved. Use of this source code is governed by a
4+
* BSD-style license that can be found in the LICENSE file.
5+
*/
6+
/**
7+
* @assertion classDefinition:
8+
* metadata abstract? class identifier typeParameters? (superclass mixins?)?
9+
* interfaces? ‘{’ (metadata classMemberDefinition)* ‘}’ |
10+
* metadata abstract? class mixinApplicationClass
11+
* ;
12+
* ...
13+
* It is a compile-time error if the superclass of a class C is specified as a
14+
* superinterface of C.
15+
* ...
16+
* @description Checks that it is a compile-time error if the superclass of a
17+
* class C is specified as a superinterface of C.
18+
* @compile-error
19+
20+
* @issue dart-lang/co19#129
21+
* @issue 31624
22+
*/
23+
class X = A with B implements A;
24+
25+
abstract class A {}
26+
class B {}
27+
28+
main() {
29+
new X();
30+
}

0 commit comments

Comments
 (0)