Skip to content

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.

dgrunwald added 4 commits May 13, 2018 00:48
 * 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.

2 participants