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

Unified Diff: pkg/compiler/lib/src/ssa/type_builder.dart

Issue 2925443002: Use failedAt in more places (ssa) (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 | « pkg/compiler/lib/src/ssa/locals_handler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/type_builder.dart
diff --git a/pkg/compiler/lib/src/ssa/type_builder.dart b/pkg/compiler/lib/src/ssa/type_builder.dart
index 11273e409c11df067168f4980f8a7931d4630357..028157a97df7bd9a04c1697166e894a7f4391a21 100644
--- a/pkg/compiler/lib/src/ssa/type_builder.dart
+++ b/pkg/compiler/lib/src/ssa/type_builder.dart
@@ -166,14 +166,15 @@ class TypeBuilder {
/// This should only be called in assertions.
bool assertTypeInContext(ResolutionDartType type, [Spannable spannable]) {
if (builder.compiler.options.useKernel) return true;
- return invariant(spannable == null ? CURRENT_ELEMENT_SPANNABLE : spannable,
- () {
- ClassElement contextClass = DartTypes.getClassContext(type);
- return contextClass == null ||
- contextClass == builder.localsHandler.contextClass;
- },
- message: "Type '$type' is not valid context of "
- "${builder.localsHandler.contextClass}.");
+ ClassElement contextClass = DartTypes.getClassContext(type);
+ assert(
+ contextClass == null ||
Johnni Winther 2017/06/06 07:41:18 Assert can take a ()->bool as the first argument.
+ contextClass == builder.localsHandler.contextClass,
+ failedAt(
+ spannable ?? CURRENT_ELEMENT_SPANNABLE,
+ "Type '$type' is not valid context of "
+ "${builder.localsHandler.contextClass}."));
+ return true;
}
HInstruction analyzeTypeArgument(
« no previous file with comments | « pkg/compiler/lib/src/ssa/locals_handler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698