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

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

Issue 1978483003: Fix AST-based type inference of top level function tearoffs (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« 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 83d6485eeeac394f93aef3144c924509eb752ecb..5b5a08d107f91ed2b4bf0a3f8966e3b9828f73c4 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -2305,6 +2305,14 @@ var f = () {};
expect(f.type.toString(), '() → dynamic');
}
+ void test_inferredType_fromTopLevelExecutableTearoff() {
+ var mainUnit = checkFile('''
+var v = print;
+''');
+ var v = mainUnit.topLevelVariables[0];
+ expect(v.type.toString(), '(Object) → void');
+ }
+
void test_inferredType_isEnum() {
var mainUnit = checkFile('''
enum E { v1 }
« 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