Skip to content

Implicit constructors should only target AttributeTargets.Constructor - #16845

Merged
psfinaki merged 5 commits into
dotnet:mainfrom
edgarfgp:fix-16794
Mar 18, 2024
Merged

Implicit constructors should only target AttributeTargets.Constructor#16845
psfinaki merged 5 commits into
dotnet:mainfrom
edgarfgp:fix-16794

Conversation

@edgarfgp

@edgarfgpedgarfgp commented Mar 8, 2024

Copy link
Copy Markdown
Contributor

Description

Fixes#16794

Before

openSystem[<AttributeUsage(AttributeTargets.Method)>]typeCustomMethodAttribute()=inherit Attribute()typeClass1[<CustomMethod>](x)=classend
[Serializable][CompilationMapping(SourceConstructFlags.ObjectType)]publicclassClass1{[CustomMethod]publicClass1(objectx){}}

After

Error 842, "This attribute is not valid for use on this language element")

Checklist

  • Test cases added

  • Release notes entry updated:

    Please make sure to add an entry with short succinct description of the change as well as link to this pull request to the respective release notes file, if applicable.

    Release notes files:

    • If anything under src/Compiler has been changed, please make sure to make an entry in docs/release-notes/.FSharp.Compiler.Service/<version>.md, where <version> is usually "highest" one, e.g. 42.8.200
    • If language feature was added (i.e. LanguageFeatures.fsi was changed), please add it to docs/releae-notes/.Language/preview.md
    • If a change to FSharp.Core was made, please make sure to edit docs/release-notes/.FSharp.Core/<version>.md where version is "highest" one, e.g. 8.0.200.

    Information about the release notes entries format can be found in the documentation.
    Example:

    If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

@edgarfgp
edgarfgp requested a review from a team as a code ownerMarch 8, 2024 20:47
@github-actions

github-actionsBot commented Mar 8, 2024

Copy link
Copy Markdown
Contributor

❗ Release notes required


✅ Found changes and release notes in following paths:

Change pathRelease notes pathDescription
src/Compilerdocs/release-notes/.FSharp.Compiler.Service/8.0.300.md
LanguageFeatures.fsidocs/release-notes/.Language/preview.md

@edgarfgp

Copy link
Copy Markdown
ContributorAuthor

This should be merged after #16790

@psfinakipsfinaki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good stuff again!

Comment threadsrc/Compiler/FSComp.txt Outdated
@edgarfgp

Copy link
Copy Markdown
ContributorAuthor

Will fix the conflicts tomorrow :)

@psfinaki

Copy link
Copy Markdown
Contributor

Sure, thanks :)

@edgarfgp

Copy link
Copy Markdown
ContributorAuthor

@psfinaki Based on your previous suggestion. I merged all the EnforceAttributeTargets LanguageFeatures into one.

@edgarfgp

Copy link
Copy Markdown
ContributorAuthor

This is ready

@psfinaki

Copy link
Copy Markdown
Contributor

Awesome, thanks :)

@psfinaki
psfinaki enabled auto-merge (squash) March 14, 2024 13:03
@edgarfgp

Copy link
Copy Markdown
ContributorAuthor

I have 2-3 more PR planned in the upcoming weeks

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

AttributeTargets.Method can be targeted in a constructor incorrectly

3 participants

@edgarfgp@psfinaki@vzarytovskii