| 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 99cfb248bfac316fb805738aad4873d7fedb17f1..03b8c4e984996896b90bafa5036c5bf6ebf2ec11 100644
|
| --- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| +++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| @@ -766,12 +766,13 @@ abstract class Compiler implements DiagnosticListener {
|
| reportDiagnostic(span, "$message", kind);
|
| }
|
|
|
| - void onDeprecatedFeature(Spannable span, String feature) {
|
| + /// Returns true if a diagnostic was emitted.
|
| + bool onDeprecatedFeature(Spannable span, String feature) {
|
| if (currentElement == null)
|
| throw new SpannableAssertionFailure(span, feature);
|
| if (!checkDeprecationInSdk &&
|
| currentElement.getLibrary().isPlatformLibrary) {
|
| - return;
|
| + return false;
|
| }
|
| var kind = rejectDeprecatedFeatures
|
| ? api.Diagnostic.ERROR : api.Diagnostic.WARNING;
|
| @@ -779,6 +780,7 @@ abstract class Compiler implements DiagnosticListener {
|
| ? MessageKind.DEPRECATED_FEATURE_ERROR.error([feature])
|
| : MessageKind.DEPRECATED_FEATURE_WARNING.error([feature]);
|
| reportMessage(spanFromSpannable(span), message, kind);
|
| + return true;
|
| }
|
|
|
| void reportDiagnostic(SourceSpan span, String message, api.Diagnostic kind);
|
| @@ -805,7 +807,7 @@ abstract class Compiler implements DiagnosticListener {
|
| if (Elements.isErroneousElement(element)) {
|
| element = element.enclosingElement;
|
| }
|
| - if (element.position() == null) {
|
| + if (element.position() == null && !element.isCompilationUnit()) {
|
| // Sometimes, the backend fakes up elements that have no
|
| // position. So we use the enclosing element instead. It is
|
| // not a good error location, but cancel really is "internal
|
|
|