Skip to content

Generate IsReadOnlyAttribute on unsupported platforms. - #14724

Merged
KevinRansom merged 13 commits into
dotnet:mainfrom
KevinRansom:readonlyattribute
Feb 22, 2023
Merged

Generate IsReadOnlyAttribute on unsupported platforms.#14724
KevinRansom merged 13 commits into
dotnet:mainfrom
KevinRansom:readonlyattribute

Conversation

@KevinRansom

@KevinRansomKevinRansom commented Feb 10, 2023

Copy link
Copy Markdown
Contributor

We recently encountered issues with IsReadOnlyAttribute on unsupported platforms

This PR, will generate one when the targeted platform does not support IsReadOnlyAttribute ... particularly netstandard2.0

Todo:

  • Clean up the code a bit and do a better job of abstracting out the generated types, because there are other attributes that are based on name matching rather than types.
  • Add some tests, I have an Okay idea how to test this, so I will add a test or two.
  • Attach CompilerGeneratedAttribute, EditorBrowsableAttribute(EditorBrowsableState.Never), DebuggerNonUserCodeAttribute to locally generated System Attribute (I.e. IsReadOnlyAttribute )

Right now I just want to see what tests are broken by this change.

@KevinRansom
KevinRansom requested a review from a team as a code ownerFebruary 10, 2023 02:51

@TIHanTIHan 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.

It looks good to me so far

Comment threadsrc/Compiler/CodeGen/IlxGen.fs Outdated
@KevinRansom
KevinRansomforce-pushed the readonlyattribute branch 2 times, most recently from a04d842 to 60af412CompareFebruary 10, 2023 22:44
Comment threadsrc/Compiler/TypedTree/TcGlobals.fs Outdated
@vzarytovskii

Copy link
Copy Markdown
Member

Does this play well with parallel ilxgen? I presume yes, but just wanted to make sure.
Introduced in #14372

@KevinRansom

Copy link
Copy Markdown
ContributorAuthor

Does this play well with parallel ilxgen? I presume yes, but just wanted to make sure. Introduced in #14372

I would expect so. The embedded typedefs are accumulated in a concurrent collection.

Comment thread.gitignore Outdated
Comment threadsrc/Compiler/Driver/CompilerImports.fs
@KevinRansom
KevinRansom enabled auto-merge (squash) February 22, 2023 09:59
@KevinRansom
KevinRansom merged commit 285fb61 into dotnet:mainFeb 22, 2023
@KevinRansom
KevinRansom deleted the readonlyattribute branch April 29, 2023 20:03
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants

@KevinRansom@vzarytovskii@TIHan@abonie@T-Gro