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

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

Issue 1724543002: fix #25487, infer block lambdas from return statements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/analyzer/test/src/task/strong/inferred_type_test.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/strong_test_helper.dart
diff --git a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
index 19ed5b3ef3cade4fb7611e78fd655b935e0e6523..e04fb308c1606490e669ce9c6fca61e3d405e024 100644
--- a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
+++ b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
@@ -52,7 +52,9 @@ void addFile(String content, {String name: '/main.dart'}) {
///
/// See [addFile] for more information about how to encode expectations in
/// the file text.
-void check() {
+///
+/// Returns the main resolved library. This can be used for further checks.
+CompilationUnit check() {
_checkCalled = true;
expect(files.getFile('/main.dart').exists, true,
@@ -93,12 +95,16 @@ void check() {
_expectErrors(resolved, errors);
}
}
+
+ return initialLibrary;
}
/// Adds a file using [addFile] and calls [check].
-void checkFile(String content) {
+///
+/// Also returns the resolved compilation unit.
+CompilationUnit checkFile(String content) {
addFile(content);
- check();
+ return check();
}
SourceSpanWithContext _createSpanHelper(
« no previous file with comments | « pkg/analyzer/test/src/task/strong/inferred_type_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698