We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Championed issue: dotnet/csharplang#2691 Speclet: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-12.0/primary-constructors.md Feature branch: https://github.com/dotnet/roslyn/tree/features/PrimaryConstructors
type Name;
class
struct
type Name(...) ...
type Name(...) : Base(...) ...
type Name(...) : Interface(...) ...
type Name : Base(...) ...
public
class C0();
struct S0() { }
partial
unsafe
params
this
param:
[CallerMemberName]
NativeIntegerAttribute
DynamicAttribute
TupleElementNames
ParameterCapturing_*_SynthesizedAttributes
[readonly] struct
[readonly] ref struct
ParameterCapturing_*
static
const
this(x)
base(x)
: Base(x)
is x
x()
@x
ParameterCapturing_011_EscapedIdentifier
nameof(x)
lock (x)
ParameterCapturing_098_Lock
using (x)
ParameterCapturing_099_Using
x switch { ... }
ParameterCapturing_099_MultiplePathsToNode_SwitchDispatch_02
ParameterCapturing_103_Deconstruction
&x
*AddressOf*
x.F
ParameterCapturing_*FixedSizeBuffer
Color Color
ParameterCapturing_*_ColorColor_*
ref
in
out
ref struct
IllegalCapturingDueToRefness_*
ParameterScope
: Base(...)
BaseArguments_17
ParameterCapturing_010_ShadowingInMethodBody
ParameterCapturing_016_Query
DefiniteAssignment_*
dynamic
: Base(@dynamic)
BaseArguments_10
: Base()
GetDeclaredSymbol()
GetSymbolInfo()
GetSpeculativeSymbolInfo()
GetSpeculativeTypeInfo()
LookupSymbols
LookupNames
: Base(x, y)
IOperation
param
paramref
ParameterCapturing_056_CapturingOfAManagedParameterMakesStructManaged
ParameterCapturing_*_Cycle
[ComImport]
*ParameterUsedInLambda_InPrimaryConstructor
ParameterCapturing_*CapturedAndPassedToBase*
ParameterCapturing_*NullableAnalysis*
readonly
readonly struct
ParameterCapturing_*_ReadonlyContext
ParameterCapturing_145_ReturnByRef
static class
SyntaxNormalizer
unmanaged
Filed issues:
class_base
The text was updated successfully, but these errors were encountered:
makeNotNullMembersMaybeNull
AlekseyTs
No branches or pull requests
Championed issue: dotnet/csharplang#2691
Speclet: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-12.0/primary-constructors.md
Feature branch: https://github.com/dotnet/roslyn/tree/features/PrimaryConstructors
Compiler
type Name;
forclass
,struct
type Name(...) ...
forclass
,struct
type Name(...) : Base(...) ...
forclass
type Name(...) : Interface(...) ...
type Name : Base(...) ...
public
primary constructor emittedclass C0();
orstruct S0() { }
partial
declarationsunsafe
params
modifierthis
modifier (error)param:
target; with other target (disallowed)[CallerMemberName]
NativeIntegerAttribute
,DynamicAttribute
,TupleElementNames
(seeParameterCapturing_*_SynthesizedAttributes
)class
,[readonly] struct
,[readonly] ref struct
(seeParameterCapturing_*
)static
members (error)const
field (error)this(x)
orbase(x)
initializer (error): Base(x)
initializer (not capturing)static
lambdas and local functions (error if captured)partial
methodis x
x()
@x
(seeParameterCapturing_011_EscapedIdentifier
)nameof(x)
lock (x)
(seeParameterCapturing_098_Lock
)using (x)
(seeParameterCapturing_099_Using
)x switch { ... }
(seeParameterCapturing_099_MultiplePathsToNode_SwitchDispatch_02
)ParameterCapturing_103_Deconstruction
)&x
(see*AddressOf*
)x.F
fixed size field (seeParameterCapturing_*FixedSizeBuffer
)Color Color
(seeParameterCapturing_*_ColorColor_*
)ref
,in
,out
, orref struct
parameters (seeIllegalCapturingDueToRefness_*
)ParameterScope
) from:: Base(...)
: error (seeBaseArguments_17
)ParameterCapturing_010_ShadowingInMethodBody
,ParameterCapturing_016_Query
)DefiniteAssignment_*
)out
parameters must be assignedout
parameters before assignmentdynamic
dispatch not allowed for: Base(@dynamic)
initializer (seeBaseArguments_10
): Base()
GetDeclaredSymbol()
GetSymbolInfo()
GetSpeculativeSymbolInfo()
,GetSpeculativeTypeInfo()
LookupSymbols
andLookupNames
for parameters: Base(x, y)
ParameterScope
): Base(x, y)
argumentsIOperation
events for synthesized constructor bodies, parameters, default valuesparam
on containing type and membersparamref
on containing type and memberspartial
declarationsstruct
managed (seeParameterCapturing_056_CapturingOfAManagedParameterMakesStructManaged
)struct
cycles from capture (seeParameterCapturing_*_Cycle
)[ComImport]
types*ParameterUsedInLambda_InPrimaryConstructor
)ParameterCapturing_*CapturedAndPassedToBase*
)ParameterCapturing_*NullableAnalysis*
)readonly
inreadonly struct
(seeParameterCapturing_*_ReadonlyContext
)readonly struct
orreadonly
method (seeParameterCapturing_*_ReadonlyContext
)ref
safety analysis of parameter references (seeParameterCapturing_145_ReturnByRef
, etc.)static class
SyntaxNormalizer
(SyntaxNormalizerTests.TestSpacingOnPrimaryConstructor/TestSemicolonBody)unmanaged
constraint requires binding all members firstPublic API
IDE test pass
Filed issues:
class_base
#67016The text was updated successfully, but these errors were encountered: