You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When LINQ method ToDictionary() is used, it returns a dictionary, that is described by reflection as IDictionary<,>. When this type is used as a parameter for BuildSpec.FromObject(), JSII runs in to problems to recognize correct type throwing ArgumentException:
System.ArgumentException: Could not infer JSII type for .NET type 'IDictionary`2' (Parameter 'type')
Expected Behavior
Method BuildSpec.FromObject() is described in C# implementation of CDK as:
public static BuildSpec FromObject(IDictionary<string,object> value)
I would expect one of two things in this case:
JSII can handle interface type.
C# implementation will not allow to use interface type.
Current Behavior
Although CDK method is described that it can receive IDictionary, argument type cannot be described by C# reflection as interface.
Reproduction Steps
Pass to the BuildSpec.FromObject() any dictionary created through LINQ method ToDictionary().
Possible Solution
No response
Additional Information/Context
No response
SDK version used
2.121.1
Environment details (OS name and version, etc.)
Fedora 39
The text was updated successfully, but these errors were encountered:
Describe the bug
When LINQ method
ToDictionary()
is used, it returns a dictionary, that is described by reflection asIDictionary<,>
. When this type is used as a parameter forBuildSpec.FromObject()
, JSII runs in to problems to recognize correct type throwingArgumentException
:Expected Behavior
Method
BuildSpec.FromObject()
is described in C# implementation of CDK as:I would expect one of two things in this case:
Current Behavior
Although CDK method is described that it can receive
IDictionary
, argument type cannot be described by C# reflection as interface.Reproduction Steps
Pass to the
BuildSpec.FromObject()
any dictionary created through LINQ methodToDictionary()
.Possible Solution
No response
Additional Information/Context
No response
SDK version used
2.121.1
Environment details (OS name and version, etc.)
Fedora 39
The text was updated successfully, but these errors were encountered: