Disallow attributes on type extensions#7481
Merged
cartermp merged 5 commits intodotnet:masterfrom Sep 4, 2019
Merged
Conversation
Contributor
Author
|
@KevinRansom @dsyme Could you guys take a look at this PR? |
dsyme
approved these changes
Sep 4, 2019
Contributor
dsyme
left a comment
There was a problem hiding this comment.
This looks good. Perhaps change the error text to "Attributes cannot be applied to type extensions"
KevinRansom
approved these changes
Sep 4, 2019
Contributor
|
@nelson-wu, can you change the error message per @dsyme, then I will merge the change. Thanks Kevin |
Contributor
Author
|
@KevinRansom @dsyme Thanks for the review! I've made the changes |
cartermp
approved these changes
Sep 4, 2019
cartermp
reviewed
Sep 4, 2019
Contributor
|
@nelson-wu, thanks mate, when it goes green, I'll merge it. |
TIHan
reviewed
Sep 9, 2019
| errorR(Error(FSComp.SR.tcTypeAbbreviationsCannotHaveAugmentations(), tyDeclRange)) | ||
|
|
||
| let (ComponentInfo (attributes, _, _, _, _, _, _, _)) = synTyconInfo | ||
| if not (List.isEmpty attributes) && (declKind = ExtrinsicExtensionBinding || declKind = IntrinsicExtensionBinding) then |
nosami
pushed a commit
to xamarin/visualfsharp
that referenced
this pull request
Feb 23, 2021
* add test for feature * add error logic to typechecker * update strings * address comments * update tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7394
Before, when attributes get added to type extensions, they can be parsed, no errors are thrown, but the attributes are silently dropped inside the type checker. This PR explicitly disallows that.