ufcpp/UfcppSample

C# 13

ufcpp opened this issue · 5 comments

微々たるやつ

入る? 14行き?

コレクション式に多少破壊的変更が入ってるのは書く?

ufcpp-live/UfcppLiveAgenda#89 (comment)

roslyn 73256

memo: ↓これ緩和されるんだっけ?

using System.Collections;
using System.Runtime.CompilerServices;

A a = [1];

[CollectionBuilder(typeof(A), nameof(Create))]
class A
{
    // Builder の方はいまだ、この GetEnumerator がないとダメ。
    public IEnumerator GetEnumerator() => throw new NotImplementedException();
    public static A Create(ReadOnlySpan<object> x) => new();
}

コレクション式、改善もある

ufcpp-live/UfcppLiveAgenda#89 (comment)

https://ufcpp.net/blog/2024/2/overload-resolution-priority/ は入るのかどうか。
Language Feature Status には並んでないけど、「これは language feature じゃなくて compiler feature だから」という可能性あり。

ちなみに、これの優先度付けは「同じ型で定義されているメソッド間のみ」とのこと。
インスタンスメソッドを拡張メソッドで優先度乗っ取りできないし、
2つのクラスに分かれた拡張メソッド群は、それぞれのクラスで優先度並べ替えたあと、それぞれの最優先メソッドを比較してオーバーロード解決。

そういや、C# 12 のときの ExperimentalAttribute 話とかも書いてない。
これは Language Feature Status に並んでる。