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

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.dart

Issue 2650943006: Allow summary type inference to infer a type of `void`. (Closed)
Patch Set: Created 3 years, 11 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/summary/link.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/src/task/strong/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index b03fcce68d8ce4382e9091230756f183dcbf22b7..03567041782c7dcead4d8f428cbf5cd9c8b58343 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -4243,6 +4243,16 @@ test() {
''');
}
+ void test_inferVariableVoid() {
+ var mainUnit = checkFile('''
+void f() {}
+var x = /*info:USE_OF_VOID_RESULT*/f();
+ ''');
+ var x = mainUnit.topLevelVariables[0];
+ expect(x.name, 'x');
+ expect(x.type.toString(), 'void');
+ }
+
void test_instanceField_basedOnInstanceField_betweenCycles() {
// Verify that all instance fields in one library cycle are inferred before
// an instance fields in a dependent library cycle.
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698