ufcpp-live / UfcppLiveAgenda

@ufcpp live streaming agenda
MIT License
24 stars 2 forks source link

.NET 6 RC 1 #45

Closed ufcpp closed 3 years ago

ufcpp commented 3 years ago

配信URL: https://youtu.be/bCagrtYDiS0

.NET 6 RC 1

image

image

その他の話題

ufcpp commented 3 years ago
class AAttribute<T> : Attribute { }
class BAttribute : Attribute { public BAttribute(Type t) { } }

[A<int>]
[A<T>] // ダメ
[B(typeof(T))] // ダメ
class X<T> { }
ufcpp commented 3 years ago
dotnet workload install wasm-tools
ufcpp commented 3 years ago

image

[*.{cs,vb}]
csharp_style_namespace_declarations=file_scoped:suggestion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1;

internal class C
{
}
ufcpp commented 3 years ago

image

ufcpp commented 3 years ago
    <ImplicitUsings>enable</ImplicitUsings>
ufcpp-live commented 3 years ago
struct A { }

public struct C
{
    const int A = 1;

    public void M()
    {
        int m = 0;
        N(m<A, A>(1)); // 今のコンパイラーは メソッド m, struct A
        N(m<A, A>(1)); // 昔のコンパイラーは int m, const int A
    }

    void m<T1, T2>(int n) { }

    void N(bool a, bool b) { }
}
ufcpp-live commented 3 years ago

image

ufcpp-live commented 3 years ago

generator 候補?

[XmlGenerator(@"
    <xml>
    </xml>
    ")]
public partial XElement M();
ufcpp-live commented 3 years ago
var s = """ここはマーカー?(json, regex, xml, etc...)
    ここから先がリテラル
    """;
ufcpp-live commented 3 years ago

image

サジェスト候補が増えすぎて、最近「脳死 ctrl + .」できなくてつらい…

ufcpp-live commented 3 years ago
// そういや top-level statements から作られる型名が「Program」に。
// User-Secrets か何かとるときに困ったらしい。
Console.WriteLine(typeof(Program));
Console.WriteLine(typeof(Program).Namespace);
Console.WriteLine(typeof(Program).IsPublic); // internal っぽい

// 名前空間、今は global。
// それも ConsoleApp1 にした方がよくない?という話あり。
ufcpp-live commented 3 years ago

image

ufcpp-live commented 3 years ago
return;

partial class Program
{
    static void Main()
    {
        Console.WriteLine("こっちの Main は呼ばれないはず");
    }
}
ufcpp-live commented 3 years ago
Main(); // 呼べたw

partial class Program
{
    static void Main()
    {
        Console.WriteLine("呼ばれた!");
    }
}
ufcpp-live commented 3 years ago

image

ufcpp-live commented 3 years ago

image image