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

Unified Diff: pkg/analyzer/test/generated/resolver_test.dart

Issue 1049303002: Issue 19929. Record the propagated type into LHS of the assignment. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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/analyzer/lib/src/generated/static_type_analyzer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 0c45439bc9831c819fb7e9e33df2a5b52477c4d1..4f24b3abe76efdf10461c06f6cef44bfdcb0349f 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -12760,14 +12760,22 @@ f() {
}
void test_mergePropagatedTypes_afterIfThen_different() {
- _assertTypeOfMarkedExpression(r'''
+ String code = r'''
main() {
var v = 0;
if (v != null) {
v = '';
}
- return v; // marker
-}''', null, null);
+ return v;
+}''';
+ {
+ SimpleIdentifier identifier = _findMarkedIdentifier(code, "v;");
+ expect(identifier.propagatedType, null);
+ }
+ {
+ SimpleIdentifier identifier = _findMarkedIdentifier(code, "v = '';");
+ expect(identifier.propagatedType, typeProvider.stringType);
+ }
}
void test_mergePropagatedTypes_afterIfThen_same() {
« no previous file with comments | « pkg/analyzer/lib/src/generated/static_type_analyzer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698