blob: d1d134b7452805ee1f13b6aac3a34da664c5e6e7 [file] [log] [blame]
// Copyright (c) 2015, 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.
// @dart = 2.9
/// @assertion Metadata can appear before ... function ...
/// @description Check that metadata is allowed before instance method
/// @author a.semenov@unipro.ru
import 'dart:mirrors';
import '../../Utils/expect.dart';
class A {
const A();
}
class B {
@A()
void b() {
}
}
main() {
var methodName = MirrorSystem .getSymbol('b');
MethodMirror bMirror =
reflectClass(B).instanceMembers[methodName] as MethodMirror;
Expect.equals('.A',
MirrorSystem.getName(bMirror.metadata[0].type.qualifiedName));
}