Skip to content

Commit

Permalink
specify that static and instance members cannot have the same name (#…
Browse files Browse the repository at this point in the history
…4004)

Closes #3936.
  • Loading branch information
jakemac53 authored Aug 1, 2024
1 parent 82ef8eb commit d771145
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion working/augmentation-libraries/feature-specification.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Augmentations

Author: rnystrom@google.com, jakemac@google.com, lrn@google.com <br>
Version: 1.30 (see [Changelog](#Changelog) at end)
Version: 1.31 (see [Changelog](#Changelog) at end)

Augmentations allow spreading your implementation across multiple locations,
both within a single file and across multiple files. They can add new top-level
Expand Down Expand Up @@ -1101,6 +1101,12 @@ introducing a lexical scope for the declaration’s contents. In the middle, eac
passes through the shared library declaration namespaces for the top-level
instances themselves.

It is a compile time error for both a static and instance member of the same
name to be defined on the same type, even if they live in different lexical
scopes. You cannot work around this restriction by moving the static member
out to an augmentation, even though it would result in an unambiguous resolution
for references to those members.

## Syntax

The grammar changes are fairly simple. The grammar is modified to allow an
Expand Down Expand Up @@ -1387,6 +1393,11 @@ to the augmentation.

## Changelog

### 1.31

* Specify that it is an error to have a static and instance member with the
same name in the fully merged declaration.

### 1.30

* Simplify extension type augmentations, don't allow them to contain the
Expand Down

0 comments on commit d771145

Please sign in to comment.