9059949ce9
This adds a check that all annotations of macro classes correspond to applied macro applications. This should be improved in the future to detect what the problem with the annotation was. For now it helps avoid inadvertently using invalid/unrecognized annotations in the macro feature development. Change-Id: I9574e2e24150d2febfc5489ab4ebf0ae2627e3fd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310101 Reviewed-by: Jens Johansen <jensj@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
14 lines
402 B
Dart
14 lines
402 B
Dart
// Copyright (c) 2023, 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:macro/annotations.dart';
|
|
|
|
int get a => 1;
|
|
const b = 2;
|
|
|
|
// TODO(johnniwinther): Support code arguments.
|
|
@AnnotationsMacro(Class)
|
|
@AnnotationsMacro(a + b)
|
|
class Class {}
|