Skip to content

[API Proposal]: Why can't access a constructor element using 'this' #7715

Closed Answered by GalaxiaGuy
Mr0N asked this question in General
Discussion options

You must be logged in to vote

Because they are parameters, not instance members:

https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/primary-constructors#primary-constructors

It's important to view primary constructor parameters as parameters even though they are in scope throughout the class definition.

Replies: 12 comments 32 replies

Comment options

You must be logged in to vote
11 replies
@Mr0N
Comment options

@Mr0N
Comment options

@CyrusNajmabadi
Comment options

@CyrusNajmabadi
Comment options

@HaloFour
Comment options

Answer selected by CyrusNajmabadi
Comment options

You must be logged in to vote
1 reply
@CyrusNajmabadi
Comment options

Comment options

You must be logged in to vote
1 reply
@CyrusNajmabadi
Comment options

Comment options

You must be logged in to vote
10 replies
@HaloFour
Comment options

@HaloFour
Comment options

@Mr0N
Comment options

@Mr0N
Comment options

@HaloFour
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@CyrusNajmabadi
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@CyrusNajmabadi
Comment options

Comment options

You must be logged in to vote
4 replies
@Mr0N
Comment options

@HaloFour
Comment options

@Mr0N
Comment options

@CyrusNajmabadi
Comment options

Comment options

You must be logged in to vote
3 replies
@HaloFour
Comment options

@Mr0N
Comment options

@HaloFour
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
Converted from issue

This discussion was converted from issue #7714 on November 23, 2023 15:54.