Expose indexing as a language interface (#4370)

This PR makes it so that types can implement the `IndexWith` interface
so that they can provide their custom indexing behavior.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
Brymer Meneses
2024-10-29 21:25:02 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent c30b1d1124
commit 89eed4220f
464 changed files with 2506 additions and 29 deletions
+1
View File
@@ -43,6 +43,7 @@ fn G() {
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool