Created
April 16, 2024 05:41
-
-
Save itn3000/d1a8c65ea70546ac9747db3dff49fbb8 to your computer and use it in GitHub Desktop.
CS0173 in dotnet sdk 8.0.300pre3 and netstandard2.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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