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

Restored requirement for struct constructors to always have formal param... #1106

Merged
merged 1 commit into from
Mar 6, 2015

Conversation

VSadov
Copy link
Member

@VSadov VSadov commented Mar 6, 2015

...eters

Fixes #1029

While overall parameterless constructors in structs are valid from IL perspective, without a convenient way to declare them they were virtually nonexistent. As we performed more and more testing, we kept discovering cases where parameterless struct constructors caused inconsistent behavior in libraries or even in some versions of CLR.

After reconsidering the potential issues arising from breaking long standing assumptions, we decided it was best for our users to restore the requirement on struct constructors to always have formal parameters.

…rameters

Fixes dotnet#1029

While overall parameterless constructors in structs are valid from IL perspective, without a convenient way to declare them they were virtually nonexistent. As we performed more and more testing, we kept discovering cases where parameterless struct constructors caused inconsistent behavior in libraries or even in some versions of CLR.

After reconsidering the potential issues arising from breaking long standing assumptions, we decided it was best for our users to restore the requirement on struct constructors to always have formal parameters.
@VSadov
Copy link
Member Author

VSadov commented Mar 6, 2015

@AlekseyTs @gafter This is a combined C#/VB fix.

@gafter
Copy link
Member

gafter commented Mar 6, 2015

I already reviewed much of this in #1052. Can you please give me a separate pull request so I don't have to duplicate the work? One way would be to write the pull request against your own branch.

@AlekseyTs
Copy link
Contributor

LGTM

@gafter
Copy link
Member

gafter commented Mar 6, 2015

Looks good.

VSadov added a commit that referenced this pull request Mar 6, 2015
Restored requirement for struct constructors to always have formal param...
@VSadov VSadov merged commit 5411ba5 into dotnet:master Mar 6, 2015
@VSadov VSadov deleted the parameterlessVB branch August 4, 2015 21:42
PathogenDavid added a commit to InfectedLibraries/roslyn that referenced this pull request Nov 2, 2020
This commit is largely just restoring parameterless constructors before they were removed by 1a6b2f0 in dotnet#1106
Note that unlike the feature before that commit, this is hidden behind a feature flag rather than a language version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restore requirement for struct constructors to always have formal parameters.
4 participants