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

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

Issue 1368793004: fix inference of object members when a method has no target (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 6f7d3db9f825009422ab20302e77beba2d4819c4..556e4187017760bd7a352bb4a6468f587ad69f56 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -12172,6 +12172,20 @@ main() {
code, typeProvider.dynamicType, typeProvider.intType);
}
+ void test_localVariableInference_declaredType_disabled_for_toString() {
+ String name = 'toString';
+ String code = '''
+main() {
+ dynamic $name = () => null;
+ $name(); // marker
+}''';
+ SimpleIdentifier identifier = _findMarkedIdentifier(code, "$name = ");
+ expect(identifier.staticType, typeProvider.dynamicType);
+ SimpleIdentifier call = _findMarkedIdentifier(code, "(); // marker");
+ expect(call.staticType, typeProvider.dynamicType);
+ expect((call.parent as Expression).staticType, typeProvider.dynamicType);
+ }
+
void test_localVariableInference_noInitializer_disabled() {
String code = r'''
main() {
« 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