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 4b0a61846a05e60b5d43ceb6c11ec6079b06f2d1..6743738f2a0fce19217915bd829a77b0795ee97e 100644 |
--- a/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart |
+++ b/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart |
@@ -110,9 +110,9 @@ class LinkBuilderImplementation<T> implements LinkBuilder<T> { |
LinkBuilderImplementation(); |
- Link<T> toLink() { |
- if (head == null) return const Link(); |
- lastLink.tail = const Link(); |
+ Link<T> toLink([Link<T> tail = const Link()]) { |
+ if (head == null) return tail; |
+ lastLink.tail = tail; |
Link<T> link = head; |
lastLink = null; |
head = null; |