Chromium Code Reviews| 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( |