From 1411f2cc75b5fe4a690cf0423e6e4a3a18c5cb0d Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Mon, 14 Jan 2019 18:21:33 -0800 Subject: [PATCH] More work --- proposals/format.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/proposals/format.md b/proposals/format.md index 629ecb3..a96d3cc 100644 --- a/proposals/format.md +++ b/proposals/format.md @@ -89,9 +89,25 @@ These cases are statically dectable though. It potentially occurs whenever there parameter passed by `out` or `ref`. In such a case the compiler must allocate a fresh `T[]` for every invocation. ### params IEnumerable +The language will allow for `params` in a method signature to have the type `IEnumerable`. The same rules will apply +to `params IEnumerable` that apply to `params T[]`: + +- Can't overload where the only difference is a `params` keyword. +- Can invoke by passing a series of `T` arguments or a single `Span` argument. +- Must be the last parameter in a method signature. +- Etc ... + +The compiler will invoke a `params IEnumerable` method exactly as it invokes a `params T[]` method. A new array will +be allocated for every call site and passed to the callee. + +### params VariantCollection + + +### params overload resolution changes +Prefer Variant, span, array, ienumerable. Efficiency here is more important. ### Customize interopolated strings -existing behavior: interpolated strings have natural type of sttring but can target type to formattablestring +existing behavior: interpolated strings have natural type of string but can target type to formattablestring change to ValueFormattableString @@ -112,5 +128,5 @@ CLR helper for stack allocating arrays Related issues - https://github.com/dotnet/csharplang/issues/1757 - https://github.com/dotnet/csharplang/issues/179 - +- https://github.com/dotnet/corefxlab/pull/2595