Skip to content

Commit 42d9919

Browse files
committed
Clarify that not even positional record type field names can collide.
Close #2428.
1 parent 5311b0b commit 42d9919

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

working/0546-patterns/records-feature-specification.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ The type `()` is the type of an empty record with no fields.
203203

204204
It is a compile-time error if a record type has any of:
205205

206-
* The same field name more than once.
206+
* The same field name more than once. *This is true even if one or both of the
207+
colliding fields is positional. We could permit collisions with positional
208+
field names since they are only used for documentation, but we disallow it
209+
because it's confusing and not useful.*
207210

208211
* Only one positional field and no trailing comma. *This isn't ambiguous,
209212
since there are no parenthesized type expressions in Dart. But prohibiting

0 commit comments

Comments
 (0)