-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Test plan for "file types" #60819
Comments
We should also consider scope of the type declaration in interactive submissions. Defining the type in one submission and accessing it in another one should probably work: > file class C {}
> new C()
> file class C {} // should hide original definition of C However, each submission has a different file name (e.g. If a file type is defined in a C.csx: file class C {} > #load "C.csx"
> new C(); // error |
Spotted one spec gap (Rikki will update spec). Otherwise the test coverage is pretty comprehensive. Only a couple minor bullets were not checked. I'll go ahead and close the test plan. |
A few missing tests were noted in recent discussion with @AlekseyTs.
|
Proposal: dotnet/csharplang#6011
Spec: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-11.0/file-local-types.md
Compiler
@file
existsfile class C { } namespace N { class C { } class D { ... use unqualified "C" (ie. type N.C) ... } }
file
type "var" (or some other contextual keyword) declaredGlobalUsingStatic_01
)InterfaceImplementation_*
)LangVersion
)Nested_*
,AccessThroughType_*
)DuplicateModifiers_01
)class
struct
,record
, record struct(see
PrimaryConstructor_01`)interface
(seeInterfaceImplementation_02
)enum
(seeFileEnum_*
)delegate
AccessModifiers_01
)StaticFileClass
)Generic_01
)Duplication_04
)Duplication_05
)BaseClause_*
)Alias_01
)Nested_06
,BaseClause_02
)SignatureUsage_*
,PrimaryConstructor_01
)Constraints_01
)AccessThroughNamespace_*
)AccessThroughGlobalUsing_*
,GlobalUsingStatic_01
,UsingStatic_*
)TopLevelStatements
)ExtensionMethod_*
)file class C { } class Program { class C { } ... method with usage of inner class C ... }
file class C { } class Program<C>{ ... method with usage of type parameter C ... }
file class C { } class Program<C, T> where T : C { }
file record C(C x);
file class C<T> where T : C { }
BaseClause_02
)FileEnum_02
)Alias_01
)file class Outer { class Inner : Outer { } }
file class Outer { class Inner : Base<Outer> { } }
),Lambda_01
)LocalFunction_01
)Cref_*
)SymbolDisplay
)Script_01
)SemanticModel_*
)Speculation_01
)bool INamedTypeSymbol.IsFile
? PossiblySyntaxTree? INamedTypeSymbol.AssociatedSyntaxTree
?NS.MyClass@MyFile
.GetTypeByMetadataName_*
)SymbolDisplayCompilerInternalOptions.IncludeContainingFileForFileTypes
IsFile
should befalse
on a nested type withfile
modifierLanguage
class C { void SomeInterface.M(FileType ft) { } }
File types binding #60977 (comment) (answer: no)Productivity
file
(done in PR File types IDE changes #62215)file
(verified manually)file
(verified manually)The text was updated successfully, but these errors were encountered: