Closed ufcpp closed 3 years ago
class AAttribute<T> : Attribute { }
class BAttribute : Attribute { public BAttribute(Type t) { } }
[A<int>]
[A<T>] // ダメ
[B(typeof(T))] // ダメ
class X<T> { }
dotnet workload install wasm-tools
[*.{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
{
}
<ImplicitUsings>enable</ImplicitUsings>
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) { }
}
generator 候補?
[XmlGenerator(@"
<xml>
</xml>
")]
public partial XElement M();
var s = """ここはマーカー?(json, regex, xml, etc...)
ここから先がリテラル
""";
サジェスト候補が増えすぎて、最近「脳死 ctrl + .」できなくてつらい…
// そういや top-level statements から作られる型名が「Program」に。
// User-Secrets か何かとるときに困ったらしい。
Console.WriteLine(typeof(Program));
Console.WriteLine(typeof(Program).Namespace);
Console.WriteLine(typeof(Program).IsPublic); // internal っぽい
// 名前空間、今は global。
// それも ConsoleApp1 にした方がよくない?という話あり。
return;
partial class Program
{
static void Main()
{
Console.WriteLine("こっちの Main は呼ばれないはず");
}
}
Main(); // 呼べたw
partial class Program
{
static void Main()
{
Console.WriteLine("呼ばれた!");
}
}
配信URL: https://youtu.be/bCagrtYDiS0
.NET 6 RC 1
https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview#17.0.0-pre.4.0
https://devblogs.microsoft.com/dotnet/update-on-dotnet-maui/
https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-6-rc-1/
その他の話題