mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 12:11:04 +01:00
This is closer to [the design](https://github.com/carbon-language/carbon-lang/blob/trunk/docs/design/expressions/indexing.md?plain=1#L55-L64), just lacking `ref`, but does remove a lot of special-casing done for the lookup. The `ErrorInst` changes in `Build*Operator` are to align with what was being done for `IndexWith`; don't do an interface lookup if the relevant operand is an error. Otherwise, that becomes visible because some files have an error operand and don't provide the interface.
11 lines
376 B
Plaintext
11 lines
376 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
package Core library "prelude/operators/index";
|
|
|
|
interface IndexWith(SubscriptType:! type) {
|
|
let ElementType:! type;
|
|
fn At[self: Self](subscript: SubscriptType) -> ElementType;
|
|
}
|