Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart b/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
| index d7375f66a2b2358fd66003d7bf6c797eb2ec6d2e..8991331f088b409f67343351abd6e2fbc7ec34dc 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
| @@ -1127,6 +1127,11 @@ class TypeGraphInferrer implements TypesInferrer { |
| // The inferrer stores the return type for a function, so we have to |
| // be careful to not return it here. |
| if (element is FunctionElement) return compiler.typesTask.functionType; |
| + |
| + // If the inferrer is null, that means that this TypeGraphInferrer |
| + // was not initialized by analyzing main. Nothing can be done in this |
| + // case, so return null indicating that the type could not be inferred. |
|
sra1
2014/08/13 21:45:26
When does this happen?
When the input is has parse
Ty Overby (Google)
2014/08/13 22:00:31
This happens on otherwise perfectly behaving code
sra1
2014/08/13 22:16:27
So TypeGraphInferer.analyzeMain is not called, but
|
| + if (inferrer == null) return null; |
| return inferrer.types.getInferredTypeOf(element).type; |
| } |