Files
sdk/tests/lib_2/mirrors/metadata_constructed_constant_test.dart
T
Jakob Roland Andersen 77a7ca98a2 Migrate test batch 226 to Dart 2.0
Specifically skipped formatting these files, since there are tests that depend
on non-standard source formatting.

Bug:
Change-Id: I3058984458a9c63b239ed8714828ec42d33316c5
Reviewed-on: https://dart-review.googlesource.com/3440
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-09-07 09:15:44 +00:00

28 lines
779 B
Dart

// compile options: --emit-metadata
// Copyright (c) 2013, 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.
library test.metadata_constructed_constant_test;
@MirrorsUsed(targets: "test.metadata_constructed_constant_test")
import 'dart:mirrors';
import 'package:expect/expect.dart';
class ConstructedConstant {
final value;
const ConstructedConstant(this.value);
toString() => 'ConstructedConstant($value)';
}
class Foo {
@ConstructedConstant(StateError)
m() {}
}
main() {
var value = reflectClass(Foo).declarations[#m].metadata.single.reflectee;
Expect.stringEquals('ConstructedConstant($StateError)', '$value');
}