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
We decide to hide the System.Nullable<T> layer in our type system, for instance, we will not generate model a nullable int type as CSharpType { IsFrameworkType: true, FrameworkType: typeof(Nullable<>), Arguments: [ typeof(int) ]
Instead, we do this:
But when we create an instance of CSharpType from typeof(int?), we still get an instance as a generic type of System.Nullable<T>.
The issue exists in this implementation is that if we do this:
CSharpTypetype=typeof(int?);
Assert.IsTrue(type.IsNullable);// this will fail.
This creates an inconsistency, and when we are creating types, we have to notice that we should not do the above, instead, we should do:
CSharpTypetype=new CSharpType(typeof(int),true);// this creates a nullable int
Assert.IsTrue(type.IsNullable);// this succeeds.
Unfortunately this is not covered by any test cases. We should add more to validate such an important infrastructure is working as expected.
The text was updated successfully, but these errors were encountered:
Describe the issue or request
We decide to hide the
System.Nullable<T>
layer in our type system, for instance, we will not generate model a nullableint
type asCSharpType { IsFrameworkType: true, FrameworkType: typeof(Nullable<>), Arguments: [ typeof(int) ]
Instead, we do this:
But when we create an instance of
CSharpType
fromtypeof(int?)
, we still get an instance as a generic type ofSystem.Nullable<T>
.The issue exists in this implementation is that if we do this:
This creates an inconsistency, and when we are creating types, we have to notice that we should not do the above, instead, we should do:
Unfortunately this is not covered by any test cases. We should add more to validate such an important infrastructure is working as expected.
The text was updated successfully, but these errors were encountered: