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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2954823002: Implement type inference for try/catch blocks. (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 304165bd5bc5dbaa6a5091a9872cab7ca21e9932..db14e9eae1877cd976b5bef3de1d233e2a204664 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -1940,9 +1940,11 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
if (catchParameters != null) {
if (catchParameters.required.length > 0) {
exception = catchParameters.required[0];
+ exception.type = type;
}
if (catchParameters.required.length > 1) {
stackTrace = catchParameters.required[1];
+ stackTrace.type = coreTypes.stackTraceClass.rawType;
}
if (catchParameters.required.length > 2 ||
catchParameters.optional != null) {
@@ -1962,10 +1964,10 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
Statement tryBlock = popStatement();
if (compileTimeErrorInTry == null) {
if (catches != null) {
- tryBlock = new TryCatch(tryBlock, catches);
+ tryBlock = new KernelTryCatch(tryBlock, catches);
}
if (finallyBlock != null) {
- tryBlock = new TryFinally(tryBlock, finallyBlock);
+ tryBlock = new KernelTryFinally(tryBlock, finallyBlock);
}
push(tryBlock);
} else {
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698