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
I came across your project and it looks very interesting. I played a bit with it and get an error when trying to use 'with' and quick binding operator.
When I write this EC# code
Point p = new Point(0, 0);
var point2 = new Point(2,2);
with (p)
{
.X = 0;
.Y = 1;
}
it generates valid C# code
Point p = new Point(0, 0);
var point2 = new Point(2, 2);
{
var tmp_10 = p;
tmp_10.X = 0;
tmp_10.Y = 1;
}
But when I try this EC# code
Point p = new Point(0, 0);
new Point(2,2)::point2;
with (p)
{
.X = 0;
.Y = 1;
}
it generates invalid C# code
Point p = new Point(0, 0);
var point2 = new Point(2, 2);
point2;
{
var tmp_10 = p;
tmp_10.X = 0;
tmp_10.Y = 1;
}
P.S. Why keeping braces from 'with' is C# code?
I tried to use only quick binding operator and it gives some error. Am I using it wrong?
The text was updated successfully, but these errors were encountered:
D0ctorWh0
changed the title
'with' bug
'with' or quick binding operator bug
Jan 31, 2021
I've reproduced the bug - including the variant where new P()::p; on a line by itself produces uncompilable code - and I should point out that with is not compatible with value types like Point, as the temporary variable is not ref. LeMP is not aware of the type system and cannot detect value types. (Potentially ref could be added on the temporary variable to fix the problem, but in other cases this could cause a compiler error). There's a note of caution in the documentation but I could have made it clearer...
Hi!
I came across your project and it looks very interesting. I played a bit with it and get an error when trying to use 'with' and quick binding operator.
When I write this EC# code
it generates valid C# code
But when I try this EC# code
it generates invalid C# code
P.S. Why keeping braces from 'with' is C# code?
I tried to use only quick binding operator and it gives some error. Am I using it wrong?
The text was updated successfully, but these errors were encountered: