1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Added 'using' field invocation support to debugger

This commit is contained in:
Brian Fiete 2022-07-30 09:41:05 -04:00
parent 14f20f10c8
commit 1a0e28af92
5 changed files with 134 additions and 7 deletions

View file

@ -0,0 +1,9 @@
ShowFile("src/UsingFields.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
AssertEvalEquals("v0.x", "123")
AssertEvalEquals("v0.GetX()", "123")
AssertEvalEquals("v1.x", "345")
AssertEvalEquals("v1.GetX()", "345")

View file

@ -31,6 +31,7 @@ namespace IDETest
Stepping_Scope.Test();
TypedPrimitives.Test();
Unions.Test();
UsingFields.Test();
Virtuals.Test();
Bug001.Test();

View file

@ -0,0 +1,43 @@
#pragma warning disable 168
using System;
namespace IDETest
{
class UsingFields
{
struct Vector2Int
{
[Union]
struct XWidth
{
public int x;
public int width;
public int GetX() => x;
}
[Union] struct YHeight : this(int y, int height);
public using XWidth xWidth;
public using YHeight yHeight;
}
struct TestVec : Vector2Int
{
}
public static void Test()
{
Vector2Int v0;
v0.x = 123;
v0.y = 234;
TestVec v1;
v1.x = 345;
v0.y = 456;
//Test_Start
int v = v0.GetX();
}
}
}