degory / ghul

compiler for the ghūl programming language
https://ghul.dev
GNU Affero General Public License v3.0
4 stars 0 forks source link

Tuple literal type covariance #1166

Closed degory closed 7 months ago

degory commented 7 months ago

Full covariance support for tuple types is awkward, because the underlying .NET Core tuple type is not covariant. However, we can support covariance when constructing tuple literals in a context where we know what element types are actually expected - for example in a return statement or expression function body, in an assignment statement or as a function actual argument.