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:
parent
14f20f10c8
commit
1a0e28af92
5 changed files with 134 additions and 7 deletions
9
IDE/Tests/Test1/scripts/UsingFields.txt
Normal file
9
IDE/Tests/Test1/scripts/UsingFields.txt
Normal 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")
|
|
@ -31,6 +31,7 @@ namespace IDETest
|
|||
Stepping_Scope.Test();
|
||||
TypedPrimitives.Test();
|
||||
Unions.Test();
|
||||
UsingFields.Test();
|
||||
Virtuals.Test();
|
||||
|
||||
Bug001.Test();
|
||||
|
|
43
IDE/Tests/Test1/src/UsingFields.bf
Normal file
43
IDE/Tests/Test1/src/UsingFields.bf
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue