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

C# 7.0 tuples #1134

Merged
merged 6 commits into from
May 29, 2018
Merged

C# 7.0 tuples #1134

merged 6 commits into from
May 29, 2018

Conversation

dgrunwald
Copy link
Member

@dgrunwald dgrunwald commented May 14, 2018

Just as object and dynamic are two different C# types that map to the same IL type; tuple types are a bunch of new C# types that map to the normal ValueTuple<> struct types.

  • Support tuple types in type system
  • Use tuple syntax where possible
  • Use element names to access tuple members, where possible
  • Make type system aware of tuple conversions
  • Avoid redundant casts by using tuple target typing
  • ILAst transform for tuple conversions

Note: deconstruction is a separate topic.

 * Use tuple literals instead of calling 'new ValueTuple<..>' constructor
 * Where available, use element names for field access
 * Make CallBuilder aware of tuple-name/dynamic type erasure, to avoid introducing casts when the types differ only in the tuple element names.
 * Make CallBuilder provide a ResolveResult with the correct C# return type for the resulting expression.
   Previously we were using the type-erased return type from the IL.
 * Fix a bug that caused us to introduce returning casts when accessing an indexer.
@dgrunwald dgrunwald merged commit 5c0c492 into master May 29, 2018
@dgrunwald dgrunwald deleted the tuple branch May 31, 2018 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant