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

Unified Diff: pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart

Issue 2921443002: Implement type inference for PropertyGet. (Closed)
Patch Set: Created 3 years, 7 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
Index: pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart b/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart
index 35e3c6cc9da159b552519b73227e9bd48cdd975e..84e64557db4c90172e02380481229e2d93901269 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart
@@ -49,15 +49,15 @@ main() {
takeOOO(/*error:COULD_NOT_INFER,error:INVALID_CAST_FUNCTION*/ min);
// Also PropertyAccess
- takeIII(new C().m);
- takeDDD(new C().m);
- takeNNN(new C().m);
- takeIDN(new C().m);
- takeDIN(new C().m);
- takeIIN(new C().m);
- takeDDN(new C().m);
- takeIIO(new C().m);
- takeDDO(new C().m);
+ takeIII(new C(). /*@target=C::m*/ m);
+ takeDDD(new C(). /*@target=C::m*/ m);
+ takeNNN(new C(). /*@target=C::m*/ m);
+ takeIDN(new C(). /*@target=C::m*/ m);
+ takeDIN(new C(). /*@target=C::m*/ m);
+ takeIIN(new C(). /*@target=C::m*/ m);
+ takeDDN(new C(). /*@target=C::m*/ m);
+ takeIIO(new C(). /*@target=C::m*/ m);
+ takeDDO(new C(). /*@target=C::m*/ m);
// Note: this is a warning because a downcast of a method tear-off could work
// (derived method can be a subtype):
@@ -69,19 +69,24 @@ main() {
// That's legal because we're loosening parameter types.
//
// We do issue the inference error though, similar to generic function calls.
- takeOON(/*error:COULD_NOT_INFER,info:DOWN_CAST_COMPOSITE*/ new C().m);
- takeOOO(/*error:COULD_NOT_INFER,info:DOWN_CAST_COMPOSITE*/ new C().m);
+ takeOON(/*error:COULD_NOT_INFER,info:DOWN_CAST_COMPOSITE*/ new C()
+ . /*@target=C::m*/ m);
+ takeOOO(/*error:COULD_NOT_INFER,info:DOWN_CAST_COMPOSITE*/ new C()
+ . /*@target=C::m*/ m);
// Note: this is a warning because a downcast of a method tear-off could work
// in "normal" Dart, due to bivariance.
//
// We do issue the inference error though, similar to generic function calls.
- takeOOI(/*error:COULD_NOT_INFER,info:DOWN_CAST_COMPOSITE*/ new C().m);
+ takeOOI(/*error:COULD_NOT_INFER,info:DOWN_CAST_COMPOSITE*/ new C()
+ . /*@target=C::m*/ m);
takeIDI(
- /*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ new C().m);
+ /*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ new C()
+ . /*@target=C::m*/ m);
takeDID(
- /*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ new C().m);
+ /*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ new C()
+ . /*@target=C::m*/ m);
}
void takeIII(int fn(int a, int b)) {}

Powered by Google App Engine
This is Rietveld 408576698