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

Unified Diff: pkg/analysis_server/test/services/completion/invocation_computer_test.dart

Issue 902983002: use propogated type for completions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 10 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
« no previous file with comments | « pkg/analysis_server/test/completion_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/completion/invocation_computer_test.dart
diff --git a/pkg/analysis_server/test/services/completion/invocation_computer_test.dart b/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
index 45eff1727a81bb96cdf47a78cef60dfc64cb9b1c..6b9886bb68a8a478248db0a7a44a41f6347b82f3 100644
--- a/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
@@ -132,6 +132,41 @@ void f(C<int> c) {
});
}
+ test_local() {
+ addTestSource('foo() {String x = "bar"; x.^}');
+ return computeFull((bool result) {
+ assertSuggestGetter('length', 'int');
+ });
+ }
+
+ test_local_is() {
+ addTestSource('foo() {var x; if (x is String) x.^}');
+ return computeFull((bool result) {
+ assertSuggestGetter('length', 'int');
+ });
+ }
+
+ test_local_propogatedType() {
+ addTestSource('foo() {var x = "bar"; x.^}');
+ return computeFull((bool result) {
+ assertSuggestGetter('length', 'int');
+ });
+ }
+
+ test_param() {
+ addTestSource('foo(String x) {x.^}');
+ return computeFull((bool result) {
+ assertSuggestGetter('length', 'int');
+ });
+ }
+
+ test_param_is() {
+ addTestSource('foo(x) {if (x is String) x.^}');
+ return computeFull((bool result) {
+ assertSuggestGetter('length', 'int');
+ });
+ }
+
test_method_parameters_mixed_required_and_named() {
addTestSource('''
class C {
« no previous file with comments | « pkg/analysis_server/test/completion_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698