Files
sdk/pkg/front_end/testcases/patterns/cache_lookups_lib.dart
T
Johnni Winther 68c326f455 [cfe] Refactor pattern matching generation
This enables caching during matching.

Closes https://github.com/dart-lang/sdk/issues/50934
Closes https://github.com/dart-lang/sdk/issues/50987

Change-Id: Iae1d8e0989029a193ba77f58338890d9bfa0c09f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279384
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-25 08:33:38 +00:00

30 lines
618 B
Dart

// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// @dart=2.19
import 'dart:collection';
import 'cache_lookups.dart';
class CustomList<E> with ListMixin<E> {
final List<E> list;
CustomList(this.list);
int get length {
counter++;
return list.length;
}
void set length(int value) {
list.length = value;
}
E operator [](int index) => list[index];
void operator []=(int index, E value) {
list[index] = value;
}
}