Update repeated-attributes.md (#3661)

This commit is contained in:
Rikki Gibson 2020-07-09 13:48:23 -07:00 committed by GitHub
parent 78a7c37efe
commit 4e69e5cde3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,7 +37,7 @@ A partial member typically facilitates the relationship between a code generator
## Solution
Allow a non-AllowMultiple attribute to be used once in each partial declaration, as long as the attribute arguments are identical. Since attribute arguments are all constants, this should not be very difficult to verify at compile time. When attributes are unioned across declarations, each non-AllowMultiple attribute will be de-duplicated and only one instance of the attribute will be emitted.
Allow a non-AllowMultiple attribute to be used once on each symbol (member, return, parameter, etc.) in each partial declaration, as long as the attribute arguments are identical. Since attribute arguments are all constants, the compiler can verify this. When attributes are unioned across declarations, each non-AllowMultiple attribute will be de-duplicated and only one instance of the attribute will be emitted.
```cs
public partial bool TryGetValue([NotNullWhen(true)] out object? value);