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
Bug description: Assume there is a static class PublicA, and it contains a private class A, the structure shown as below:
public static class PublicA
{
public static object GetList()
{
return new List<A> { new A("hi") };
}
private class A
{
public A(string name)
{
this.Name = name;
}
public string Name { get; set; }
}
}
We call the static method in another class (which has no access to class A), and use dynamic as an intermediate variable. Code as below:
var list = PublicA.GetList();
dynamic dy = list;
var result = dy[0];
When running through the code, the error occurs with the message: Cannot apply indexing with [] to an expression of type 'object'
So, the root cause of the issue is that when we cast a list value (with a specific object Generics, and the caller has no access to this class) to dynamic, some features of List would be lost.
Changed projects
AdaptiveExpressions
AdaptiveExpressions.Tests
[LG,R9]
The text was updated successfully, but these errors were encountered:
Close: #3555
Bug description: Assume there is a static class
PublicA
, and it contains a private classA
, the structure shown as below:We call the static method in another class (which has no access to class
A
), and use dynamic as an intermediate variable. Code as below:When running through the code, the error occurs with the message:
Cannot apply indexing with [] to an expression of type 'object'
So, the root cause of the issue is that when we cast a list value (with a specific object Generics, and the caller has no access to this class) to dynamic, some features of
List
would be lost.Changed projects
[LG,R9]
The text was updated successfully, but these errors were encountered: