Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add speclet for file-local types #6233

Merged
merged 8 commits into from
Jul 11, 2022
Merged

Conversation

RikkiGibson
Copy link
Contributor

Related to dotnet/roslyn#60819

@RikkiGibson RikkiGibson requested a review from a team as a code owner June 24, 2022 00:07
proposals/file-types.md Outdated Show resolved Hide resolved
proposals/file-types.md Outdated Show resolved Hide resolved
proposals/file-types.md Outdated Show resolved Hide resolved
proposals/file-types.md Outdated Show resolved Hide resolved
Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks (iteration 4)

proposals/file-types.md Outdated Show resolved Hide resolved
proposals/file-types.md Outdated Show resolved Hide resolved
proposals/file-types.md Outdated Show resolved Hide resolved
proposals/file-types.md Outdated Show resolved Hide resolved
@RikkiGibson
Copy link
Contributor Author

It was suggested in email thread with LDT that we do nothing re: attributes. i.e. you can declare 'file class C : System.Attribute' and use it in '[C]', and we won't give a diagnostic or do anything else unusual. It wasn't clear if we had consensus about that.

@@ -137,14 +137,22 @@ namespace NS1
Therefore, we don't specify the feature in terms of which scope the type is contained in, but rather as additional "filtering rules" in member lookup.

### Attributes
In the initial iteration of the feature, a file type is not allowed to be used as an attribute. Such attributes are of limited utility for users who are unaware of the internal name generation strategy used in the implementation.
File classes are permitted to be attribute types, and can be used as attributes within both file types and non-file types, just as if the attribute type were a non-file type. The metadata name of the file-local attribute type still goes through the same name generation strategy as other file-local types. This means detecting the presence of a file-type by a hard-coded string name is likely to be impractical, because it requires depending on the internal name generation strategy of the compiler, which may change over time. However, detecting via `typeof(MyFileLocalAttribute)` works.
Copy link
Member

@cston cston Jul 8, 2022

Choose a reason for hiding this comment

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

There are several different names used: "file type", "file-local ... type", and "file-type". Consider choosing one or perhaps two names to use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'm going to make a pass to change everything to "file-local" types, here and in the implementation.

@RikkiGibson RikkiGibson changed the title Add speclet for file types Add speclet for file-local types Jul 11, 2022
@RikkiGibson RikkiGibson merged commit 66bacc4 into dotnet:main Jul 11, 2022
@RikkiGibson RikkiGibson deleted the file-types branch July 11, 2022 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants