Skip to content

Instantly share code, notes, and snippets.

@itn3000
Created April 16, 2024 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itn3000/d1a8c65ea70546ac9747db3dff49fbb8 to your computer and use it in GitHub Desktop.
Save itn3000/d1a8c65ea70546ac9747db3dff49fbb8 to your computer and use it in GitHub Desktop.
CS0173 in dotnet sdk 8.0.300pre3 and netstandard2.0
using System;
namespace a
{
public class Class1
{
public static void X()
{
dynamic x = GetDynamic();
// CS0173 with .NET SDK 8.0.300pre3 and netstandard2.0
var moge = string.IsNullOrEmpty(x.A) ? null : DateTime.Parse(x.A);
Console.WriteLine($"{x}");
}
static object GetDynamic()
{
return new { A = DateTime.Now.ToString("yyyy/MM/dd HH-mm-ss") };
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment