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

Unified Diff: lib/src/span_exception.dart

Issue 1722603005: Make SourceSpanException.source a getter (Closed) Base URL: https://github.com/dart-lang/source_span.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/span_exception.dart
diff --git a/lib/src/span_exception.dart b/lib/src/span_exception.dart
index ab07046143047601733084c0ea9c433a7158ac64..921e62095353c1ae7d4278ff7477094892cced32 100644
--- a/lib/src/span_exception.dart
+++ b/lib/src/span_exception.dart
@@ -32,10 +32,13 @@ class SourceSpanException implements Exception {
/// A [SourceSpanException] that's also a [FormatException].
class SourceSpanFormatException extends SourceSpanException
implements FormatException {
- final source;
+ final _source;
+
+ // Subclasses may narrow the type.
+ dynamic get source => _source;
int get offset => span == null ? null : span.start.offset;
- SourceSpanFormatException(String message, SourceSpan span, [this.source])
+ SourceSpanFormatException(String message, SourceSpan span, [this._source])
: super(message, span);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698