-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initializer (InitializerExpressionSyntax
) is ignored for value types
#243
Labels
🐛 bug
Something isn't working
Comments
adrianoc
added a commit
that referenced
this issue
Aug 6, 2023
…ss value type instantiation (#243) this uncovered a bunch of scenarios in which simple instantition of parameterless value type is not working. These will be fixed in a future commit and handling of ObjectInitializerExpression for those in a follow up one
adrianoc
added a commit
that referenced
this issue
Aug 6, 2023
…n in tests accordingly this issue was discovered while working on #243
adrianoc
added a commit
that referenced
this issue
Aug 6, 2023
add extra tests to cover the following scenarios: struct S
{
public int Value { get; set; }
public static bool operator>(in S l, in S r) => false;
public static bool operator<(in S l, in S r) => false;
}
class Foo
{
S TernaryOperators(int i) => i == 2 ? new S { Value = i } : new S { Value = i };
S GetArrow() => new S { Value = 42 };
S GetReturn() { return new S { Value = 42 }; }
int X(int[] a) => a[ new S { Value = 1 } .Value ];
bool P(int i) => new S { Value = 2} < new S { Value = 3 };
} |
Ternary operator handling may be affected by #248 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No code is generated for the object initializer (
{ Name = "A", Value = 42 }
)The text was updated successfully, but these errors were encountered: