Open Gaoyifei1011 opened 2 months ago
@manodasanW I think we should not use source generator at the first place, instead we should generate an assembly just like what WPF does, so that things like this can get covered.
Sergio did bring up a related idea with separate assembly for the generic instantiations and vtable lookup table that is being considered. But I don't think that would solve this problem where these are internal .NET types that CsWinRT won't directly be aware of unless you were thinking of something there?
The plan to address that is to make use of the statically known interface on the projection and provide a vtable for that when the one for the class isn't available. This is tracked by #1661. The tricky part will be minimizing size impact.
Describe the bug
InvaildCastException occurs when the argument is passed in as a collection expression 传入参数为集合表达式时会发生 InvaildCastException
To Reproduce
Compositor. CreateEffectFactory() have multiple overloaded method, one of the second parameter for IEnumerable, at this time if in the second parameter to set expression directly, causing InvaildCastException
Compositor.CreateEffectFactory() 方法有多个重载,其中一个第二个参数为 IEnumerable,这时如果在第二个参数中直接传入集合表达式,引发 InvaildCastException
Expected behavior
Provide warning or support collection expression in parameter
Version Info
CsWinRT 2.1.1 Windows SDK 10.0.26100.0 .NET SDK 9.0.0-preview7
Additional context
Found in the process of debugging, set the type of the expression is <>z_ReadOnlySingleElementList
调试的过程中,发现集合表达式生成的类型是<>z_ReadOnlySingleElementList