Skip to content

Commit 174ce40

Browse files
pqCommit Queue
authored andcommitted
[CQ] remove macro tests
Change-Id: I2dc14124152c0902781c3044c4e66c8e058dcd1e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406741 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Auto-Submit: Phil Quitslund <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
1 parent 6e17841 commit 174ce40

File tree

5 files changed

+0
-45
lines changed

5 files changed

+0
-45
lines changed

pkg/linter/lib/src/extensions.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,6 @@ extension ElementExtension on Element2? {
321321
self.name3 == 'print' &&
322322
self.firstFragment.libraryFragment.element.isDartCore;
323323
}
324-
325-
bool get isMacro => switch (this) {
326-
ClassElement2(:var isMacro) => isMacro,
327-
_ => false,
328-
};
329324
}
330325

331326
extension ExpressionExtension on Expression? {

pkg/linter/lib/src/rules/prefer_const_constructors_in_immutables.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'package:analyzer/src/lint/constants.dart'; // ignore: implementation_imp
99
import 'package:collection/collection.dart' show IterableExtension;
1010

1111
import '../analyzer.dart';
12-
import '../extensions.dart';
1312

1413
const _desc = r'Prefer declaring `const` constructors on `@immutable` classes.';
1514

@@ -47,7 +46,6 @@ class _Visitor extends SimpleAstVisitor<void> {
4746
if (element.isConst) return;
4847
if (node.body is! EmptyFunctionBody) return;
4948
var enclosingElement = element.enclosingElement2;
50-
if (enclosingElement.isMacro) return;
5149

5250
if (enclosingElement.mixins.isNotEmpty) return;
5351
if (!_hasImmutableAnnotation(enclosingElement)) return;

pkg/linter/test/rules/camel_case_types_test.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,6 @@ extension type FooBar(int i) {}
164164
''');
165165
}
166166

167-
test_macroClass_lowerCase() async {
168-
await assertDiagnostics(
169-
r'''
170-
macro class a {}
171-
''',
172-
[lint(12, 1)],
173-
);
174-
}
175-
176167
test_mixin_lowerCase() async {
177168
await assertDiagnostics(
178169
r'''

pkg/linter/test/rules/one_member_abstracts_test.dart

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@ class OneMemberAbstractsTest extends LintRuleTest {
1717
@override
1818
String get lintRule => LintNames.one_member_abstracts;
1919

20-
test_macroClass() async {
21-
await assertDiagnostics(
22-
r'''
23-
abstract macro class M {
24-
void m();
25-
}
26-
''',
27-
[
28-
// TODO(pq): add abstract macro compilation error when implemented
29-
],
30-
);
31-
}
32-
3320
test_oneMember_abstract() async {
3421
await assertDiagnostics(
3522
r'''

pkg/linter/test/rules/prefer_const_constructors_in_immutables_test.dart

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -411,22 +411,6 @@ class B extends A {
411411
);
412412
}
413413

414-
test_macroConstructor() async {
415-
await assertDiagnostics(
416-
r'''
417-
import 'package:meta/meta.dart';
418-
419-
@immutable
420-
macro class M {
421-
M();
422-
}
423-
''',
424-
[
425-
// TODO(pq): add non-const constructor compilation error when implemented
426-
],
427-
);
428-
}
429-
430414
test_parameterizedType() async {
431415
// Verify we aren't doing an unsafe cast to a `ConstructorFragment` in type.dart.
432416
// b/374689139

0 commit comments

Comments
 (0)