ufcpp / UfcppSample

http://ufcpp.net/ 向けのサンプル
Apache License 2.0
133 stars 41 forks source link

C# 13 #462

Open ufcpp opened 1 month ago

ufcpp commented 1 month ago

たぶん入る

微々たるやつ

ufcpp commented 1 month ago

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

https://github.com/ufcpp-live/UfcppLiveAgenda/issues/89#issuecomment-2047602991

roslyn 73256

ufcpp commented 1 month ago

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 commented 1 month ago

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

https://github.com/ufcpp-live/UfcppLiveAgenda/issues/89#issuecomment-2053653416

ufcpp commented 1 month ago

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

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

ufcpp commented 1 month ago

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