CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

InvaildCastException occurs when the argument is passed in as a collection expression

Open Gaoyifei1011 opened this issue 1 year ago • 3 comments

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 {CC80183B-4C3B-431D-93F0-ECBFCE4FEAFB} caf934614c1344212b350007c479ec7f f13e29d919a261020e21de40b27c3622 9cb94d616e2a7dba14cb33d7ce92c3e4

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 646565e7042e4e16ff4a2f15458a9c6e

Gaoyifei1011 avatar Sep 02 '24 14:09 Gaoyifei1011