Skip to content

Commit bcc2d96

Browse files
committed
Remove incorrect rules from trait names proposal
The proposal currently adds some rules to trait names. However some of those rules conflict with the statement that all trait names must be valid Swift identifiers. So let's remove those rules.
1 parent 4273835 commit bcc2d96

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

proposals/0450-swiftpm-package-traits.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,14 +512,8 @@ Since traits can show up both in the `Package.swift` and in source code when
512512
checking if a trait is enabled, the allowed characters for a trait name are
513513
restricted to [legal Swift
514514
identifier](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/summaryofthegrammar/).
515-
Hence, the following rules are enforced on trait names:
516-
517-
- The first character must be a [Unicode XID start
518-
character](https://unicode.org/reports/tr31/#Figure_Code_Point_Categories_for_Identifier_Parsing)
519-
(most letters), a digit, or `_`.
520-
- Subsequent characters must be a [Unicode XID continue
521-
character](https://unicode.org/reports/tr31/#Figure_Code_Point_Categories_for_Identifier_Parsing)
522-
(a digit, `_`, or most letters), `-`, or `+`.
515+
Additional, the following rules are enforced on trait names:
516+
523517
- `default` and `defaults` (in any letter casing combination) are not allowed as
524518
trait names to avoid confusion with default traits.
525519

0 commit comments

Comments
 (0)