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

Unified Diff: sdk/lib/_internal/compiler/implementation/util/link_implementation.dart

Issue 11778039: Report arity errors on user definable operators. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments + Link test updated. Created 7 years, 11 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
Index: sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart b/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
index 491bd4438b81b8f91d52e302cd7deabe038baf1f..90b863cd92d6b20ab124d0fc6c1fb146c0940891 100644
--- a/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
+++ b/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
@@ -68,6 +68,16 @@ class LinkEntry<T> extends Link<T> {
return result;
}
+ Link<T> skip(int n) {
+ Link<T> link = this;
+ for (int i = 0 ; i < n ; i++) {
+ if (link.isEmpty) {
+ throw new RangeError('Index $n out of range');
+ }
+ link = link.tail;
+ }
+ return link;
+ }
bool get isEmpty => false;
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/util/link.dart ('k') | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698