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

Forbid constructing tuple-related types via "new" #14216

Closed
gafter opened this issue Sep 30, 2016 · 2 comments
Closed

Forbid constructing tuple-related types via "new" #14216

gafter opened this issue Sep 30, 2016 · 2 comments

Comments

@gafter
Copy link
Member

gafter commented Sep 30, 2016

We decided for forbid creating a tuple type using the tuple syntax (#10891) so that we can reserve the syntax new (1, 2) for a target-typed object creation expression (#35). However there are related syntax forms that we may want to forbid as well.

new (Int32, Int32)[] { (1, 2), (1, 2) }
new (Int32, Int32)?()
new (Int32, Int32)?[] { (1, 2), null }
new (Int32, Int32)?[10]

Forbidding these syntax forms today will make integration of #35 easier later.

@gafter gafter added this to the 2.0 (RC) milestone Sep 30, 2016
@VSadov VSadov modified the milestones: 2.0 (RTM), 2.0 (RC) Oct 6, 2016
@VSadov VSadov self-assigned this Oct 6, 2016
@jcouv jcouv modified the milestones: 2.0 (RC.3), 2.0 (RTM) Dec 16, 2016
@jaredpar jaredpar assigned jcouv and unassigned VSadov Jan 9, 2017
@jcouv
Copy link
Member

jcouv commented Jan 9, 2017

Closing based on 2016-10-18 LDM notes:

Use of tuples in new

#14216
We should certainly allow arrays of tuples to be created. Probably fine to also keep allowing ?.

@jcouv jcouv closed this as completed Jan 9, 2017
@jcouv jcouv added the Resolution-Answered The question has been answered label Jan 9, 2017
@VSadov
Copy link
Member

VSadov commented Jan 10, 2017

@jcouv Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants