Skip to content

Commit d771145

Browse files
authored
specify that static and instance members cannot have the same name (#4004)
Closes #3936.
1 parent 82ef8eb commit d771145

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

working/augmentation-libraries/feature-specification.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Augmentations
22

33
4-
Version: 1.30 (see [Changelog](#Changelog) at end)
4+
Version: 1.31 (see [Changelog](#Changelog) at end)
55

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

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

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

13881394
## Changelog
13891395

1396+
### 1.31
1397+
1398+
* Specify that it is an error to have a static and instance member with the
1399+
same name in the fully merged declaration.
1400+
13901401
### 1.30
13911402

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

0 commit comments

Comments
 (0)