blob: 6382a00392cf30462a1c98da3c37c38c6f90bd85 [file] [log] [blame]
// Copyright (c) 2021, 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.
/// @assertion In [dart:mirrors], the name of the constructor is still just [C],
/// not [] (that's not a valid symbol, and we don't want to break existing
/// reflection using code).
/// @description Checks that the name of the constructor in [dart::mirrors] is
/// [C].
/// @author
// SharedOptions=--enable-experiment=constructor-tearoffs
import "../../Utils/expect.dart";
import 'dart:mirrors';
class C {
int x;
checkName() {
bool found = false;
ClassMirror classMirror = reflect(C(1)).type;
for (var v in classMirror.declarations.values) {
String name = MirrorSystem.getName(v.simpleName);
found = name == "C";
if(name == "new") {"Constructor name is new");
void main() {
var v =;