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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2997513002: Use "bool" as the downward inference context for assert conditions. (Closed)
Patch Set: Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// This file declares a "shadow hierarchy" of concrete classes which extend 5 /// This file declares a "shadow hierarchy" of concrete classes which extend
6 /// the kernel class hierarchy, adding methods and fields needed by the 6 /// the kernel class hierarchy, adding methods and fields needed by the
7 /// BodyBuilder. 7 /// BodyBuilder.
8 /// 8 ///
9 /// Instances of these classes may be created using the factory methods in 9 /// Instances of these classes may be created using the factory methods in
10 /// `ast_factory.dart`. 10 /// `ast_factory.dart`.
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 KernelAssertStatement(Expression condition, 112 KernelAssertStatement(Expression condition,
113 {Expression message, int conditionStartOffset, int conditionEndOffset}) 113 {Expression message, int conditionStartOffset, int conditionEndOffset})
114 : super(condition, 114 : super(condition,
115 message: message, 115 message: message,
116 conditionStartOffset: conditionStartOffset, 116 conditionStartOffset: conditionStartOffset,
117 conditionEndOffset: conditionEndOffset); 117 conditionEndOffset: conditionEndOffset);
118 118
119 @override 119 @override
120 void _inferStatement(KernelTypeInferrer inferrer) { 120 void _inferStatement(KernelTypeInferrer inferrer) {
121 inferrer.listener.assertStatementEnter(this); 121 inferrer.listener.assertStatementEnter(this);
122 inferrer.inferExpression(condition, null, false); 122 inferrer.inferExpression(
123 condition, inferrer.coreTypes.boolClass.rawType, false);
123 if (message != null) { 124 if (message != null) {
124 inferrer.inferExpression(message, null, false); 125 inferrer.inferExpression(message, null, false);
125 } 126 }
126 inferrer.listener.assertStatementExit(this); 127 inferrer.listener.assertStatementExit(this);
127 } 128 }
128 } 129 }
129 130
130 /// Shadow object for [AwaitExpression]. 131 /// Shadow object for [AwaitExpression].
131 class KernelAwaitExpression extends AwaitExpression 132 class KernelAwaitExpression extends AwaitExpression
132 implements KernelExpression { 133 implements KernelExpression {
(...skipping 2328 matching lines...) Expand 10 before | Expand all | Expand 10 after
2461 accept(v) => unsupported("accept", -1, null); 2462 accept(v) => unsupported("accept", -1, null);
2462 2463
2463 accept1(v, arg) => unsupported("accept1", -1, null); 2464 accept1(v, arg) => unsupported("accept1", -1, null);
2464 2465
2465 getStaticType(types) => unsupported("getStaticType", -1, null); 2466 getStaticType(types) => unsupported("getStaticType", -1, null);
2466 2467
2467 transformChildren(v) => unsupported("transformChildren", -1, null); 2468 transformChildren(v) => unsupported("transformChildren", -1, null);
2468 2469
2469 visitChildren(v) => unsupported("visitChildren", -1, null); 2470 visitChildren(v) => unsupported("visitChildren", -1, null);
2470 } 2471 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/front_end/testcases/inference/assert.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698