Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Unified Diff: tests/lib/mirrors/initializing_formals_test.dart

Issue 26346002: Correctly report the type of initializing formals declared without an explicit type to be the type … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runtime/vm/parser.cc ('K') | « tests/lib/lib.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/initializing_formals_test.dart
diff --git a/tests/lib/mirrors/initializing_formals_test.dart b/tests/lib/mirrors/initializing_formals_test.dart
index 6dcfce136f8cf25636f47931b0f3fbc5614147ae..95befe9b5ce94f03a0464ef670988adeb8abd898 100644
--- a/tests/lib/mirrors/initializing_formals_test.dart
+++ b/tests/lib/mirrors/initializing_formals_test.dart
@@ -19,10 +19,13 @@ class Class<T> {
Class.optPos([this.stringField = 'default']);
Class.generic(this.tField);
Class.private(this._privateField);
+
+ Class.explicitType(num this.intField);
hausner 2013/10/07 23:03:08 Try also with explicit dynamic.
rmacnak 2013/10/08 01:01:01 Done.
+ Class.withVar(var this.intField);
}
hausner 2013/10/07 23:03:08 Should you cover factories and forwarding construc
rmacnak 2013/10/08 01:01:01 Initializing formals aren't allowed there.
class Constant {
- final value;
+ final num value;
const Constant(this.value);
const Constant.marked(final this.value);
}
@@ -32,7 +35,7 @@ main() {
pm = reflectClass(Class).constructors[#Class.nongeneric].parameters.single;
Expect.equals(#intField, pm.simpleName);
- Expect.equals(reflectClass(int), pm.type); /// 01: ok
+ Expect.equals(reflectClass(int), pm.type);
Expect.isFalse(pm.isNamed);
Expect.isFalse(pm.isFinal);
Expect.isFalse(pm.isOptional);
@@ -43,7 +46,7 @@ main() {
pm = reflectClass(Class).constructors[#Class.named].parameters.single;
Expect.equals(#boolField, pm.simpleName);
- Expect.equals(reflectClass(bool), pm.type); /// 01: ok
+ Expect.equals(reflectClass(bool), pm.type);
Expect.isTrue(pm.isNamed);
Expect.isFalse(pm.isFinal);
Expect.isTrue(pm.isOptional);
@@ -54,7 +57,7 @@ main() {
pm = reflectClass(Class).constructors[#Class.optPos].parameters.single;
Expect.equals(#stringField, pm.simpleName);
- Expect.equals(reflectClass(String), pm.type); /// 01: ok
+ Expect.equals(reflectClass(String), pm.type);
Expect.isFalse(pm.isNamed);
Expect.isFalse(pm.isFinal);
Expect.isTrue(pm.isOptional);
@@ -66,7 +69,7 @@ main() {
pm = reflectClass(Class).constructors[#Class.generic].parameters.single;
Expect.equals(#tField, pm.simpleName);
- Expect.equals(reflectClass(Class).typeVariables.single, pm.type); /// 01: ok
+ Expect.equals(reflectClass(Class).typeVariables.single, pm.type);
Expect.isFalse(pm.isNamed);
Expect.isFalse(pm.isFinal);
Expect.isFalse(pm.isOptional);
@@ -86,9 +89,31 @@ main() {
Expect.isFalse(pm.isStatic);
Expect.isFalse(pm.isTopLevel);
+ pm = reflectClass(Class).constructors[#Class.explicitType].parameters.single;
+ Expect.equals(#intField, pm.simpleName);
+ Expect.equals(reflectClass(num), pm.type);
+ Expect.isFalse(pm.isNamed);
+ Expect.isFalse(pm.isFinal);
+ Expect.isFalse(pm.isOptional);
+ Expect.isFalse(pm.hasDefaultValue);
+ Expect.isFalse(pm.isPrivate);
+ Expect.isFalse(pm.isStatic);
+ Expect.isFalse(pm.isTopLevel);
+
+ pm = reflectClass(Class).constructors[#Class.withVar].parameters.single;
+ Expect.equals(#intField, pm.simpleName);
+ Expect.equals(reflectClass(int), pm.type); // N.B.
+ Expect.isFalse(pm.isNamed);
+ Expect.isFalse(pm.isFinal);
+ Expect.isFalse(pm.isOptional);
+ Expect.isFalse(pm.hasDefaultValue);
+ Expect.isFalse(pm.isPrivate);
+ Expect.isFalse(pm.isStatic);
+ Expect.isFalse(pm.isTopLevel);
+
pm = reflectClass(Constant).constructors[#Constant].parameters.single;
Expect.equals(#value, pm.simpleName);
- Expect.equals(currentMirrorSystem().dynamicType, pm.type);
+ Expect.equals(reflectClass(num), pm.type);
Expect.isFalse(pm.isNamed);
Expect.isFalse(pm.isFinal); // N.B.
Expect.isFalse(pm.isOptional);
@@ -99,7 +124,7 @@ main() {
pm = reflectClass(Constant).constructors[#Constant.marked].parameters.single;
Expect.equals(#value, pm.simpleName);
- Expect.equals(currentMirrorSystem().dynamicType, pm.type);
+ Expect.equals(reflectClass(num), pm.type);
Expect.isFalse(pm.isNamed);
Expect.isTrue(pm.isFinal); // N.B.
Expect.isFalse(pm.isOptional);
« runtime/vm/parser.cc ('K') | « tests/lib/lib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698