dart-sdk/tests/language/regress_22700_test.dart
regis@google.com 438d13fc9e Allow direct access to type parameters from factory (issue 22700).
Add regression test.
Fix wrong test and update status files.

Review URL: https://codereview.chromium.org//985203002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44339 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 19:39:17 +00:00

31 lines
599 B
Dart

// 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.
import "package:expect/expect.dart";
class WrapT<T> {
Type get type => T;
}
printAndCheck(t) {
print(t);
Expect.equals(String, t);
}
class MyClass<T> {
factory MyClass.works() {
Type t = new WrapT<T>().type;
printAndCheck(t);
}
factory MyClass.works2() {
printAndCheck(T);
}
}
main() {
new MyClass<String>.works();
new MyClass<String>.works2();
}