DevTeam / Pure.DI

Pure DI for .NET without frameworks!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C#12 collection expressions are not supported

Serg046 opened this issue · comments

C# 12 brings a new way to instantiate collections via brackets like this [1,2,3]. Currently this is not supported so that Bind<IDependency>(tags: "tag").To<Dependency>() works fine but Bind<IDependency>(tags: ["tag"]).To<Dependency>() fails with "DIE001 ["tag"] must be a constant value of type System.Object.". Btw, C# treats it as a constant, you can use such a value in attributes, etc.

In order to accomplish this task, we need to support Roslyn 4.8