| Index: dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| index 8ee164d98418ac27c4a751eccd5205663a32f80f..c23d8fafd1848801611b146a82301f17835a1ddd 100644
|
| --- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| +++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| @@ -1220,7 +1220,7 @@ abstract class Compiler implements DiagnosticListener {
|
| "library."});
|
| }
|
| } else {
|
| - if (main.isErroneous) {
|
| + if (main.isErroneous && main.isSynthesized) {
|
| reportFatalError(main, MessageKind.GENERIC,
|
| {'text': "Cannot determine which '$MAIN' to use."});
|
| } else if (!main.isFunction) {
|
| @@ -1608,10 +1608,11 @@ abstract class Compiler implements DiagnosticListener {
|
| }
|
|
|
| SourceSpan spanFromElement(Element element) {
|
| - if (Elements.isErroneousElement(element)) {
|
| + while (element != null && element.isSynthesized) {
|
| element = element.enclosingElement;
|
| }
|
| - if (element.position == null &&
|
| + if (element != null &&
|
| + element.position == null &&
|
| !element.isLibrary &&
|
| !element.isCompilationUnit) {
|
| // Sometimes, the backend fakes up elements that have no
|
|
|