Skip to content

Commit c5168c9

Browse files
committed
Remove best-effort rule, make it a lint instead
1 parent caef6d4 commit c5168c9

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

proposals/p3720.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3838
- [Reference binding produces a value that wraps a pointer](#reference-binding-produces-a-value-that-wraps-a-pointer)
3939
- [Separate interface for compile-time binding instead of type binding](#separate-interface-for-compile-time-binding-instead-of-type-binding)
4040
- [Allow `extend api` of an incomplete type](#allow-extend-api-of-an-incomplete-type)
41+
- [Make some name resolutions cases unambiguous with `extend api`](#make-some-name-resolutions-cases-unambiguous-with-extend-api)
4142

4243
<!-- tocstop -->
4344

@@ -262,22 +263,24 @@ How does this arise?
262263
> [member_access.md](/docs/design/expressions/member_access.md) says that
263264
> `v.(C.Static)` and `r.(C.Static)` are both invalid, because they don't perform
264265
> member name lookup, instance binding, nor impl lookup -- the `v.` and `r.`
265-
> portions are redundant. That rule is now a best-effort diagnostic and should
266-
> not trigger as the result of rewrites performed by the compiler or when the
267-
> problem is not contained in a single expression. For example, it would be
268-
> reasonable for the compiler to allow:
266+
> portions are redundant. That rule is removed by this proposal.
267+
>
268+
> Instead, tools such as linters can option such code as suspicious on a
269+
> best-effort basis, particularly when the issue is contained in a single
270+
> expression. Such tools may still allow code that performs the same operation
271+
> across multiple statements, as in:
269272
>
270273
> ```carbon
271274
> let M:! auto = C.Static
272275
> v.(M)();
273276
> r.(M)();
274277
> ```
275278
>
276-
> Note that with overloaded names, the `M` might be an instance member in some
279+
> Note that if `M` is an overloaded name, it could be an instance member in some
277280
> cases and a non-instance member in others, depending on the arguments passed.
278-
> Since the call happens after binding, this gives another reason to consider
279-
> this a best-effort error on a whole expression, rather than a strict rule just
280-
> about binding.
281+
> This is another reason to delegate this to linters on a best-effort error
282+
> basis analyzing a whole expression, rather than a strict rule just about
283+
> binding.
281284
282285
The binding operators are defined using three dedicated interfaces:
283286
@@ -1266,3 +1269,8 @@ This was discussed in the
12661269
[proposal review](https://github.com/carbon-language/carbon-lang/pull/3720/files#r1507988547)
12671270
and
12681271
[the #typesystem channel on Discord](https://discord.com/channels/655572317891461132/708431657849585705/1217499991329738852).
1272+
1273+
### Make some name resolutions cases unambiguous with `extend api`
1274+
1275+
TODO: See
1276+
[comment on #3720](https://github.com/carbon-language/carbon-lang/pull/3720/files#r1513671030)

0 commit comments

Comments
 (0)