Skip to content

Commit c16b049

Browse files
committed
use concrete type
1 parent 8bd49e8 commit c16b049

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/DotRead.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@
33

44
namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read;
55

6-
public class DotRead(Name @object, IValue property) : Simple(
6+
public class DotRead(Name @object, Constant property) : Simple(
77
leftValue: @object,
88
binaryOperator: ".",
99
rightValue: property), IReadFromComplexData
1010
{
11-
private readonly IValue _property = property;
12-
1311
public Simple ToAssignment(IValue value) =>
14-
new DotAssignment(@object.ToString(), _property, value);
12+
new DotAssignment(@object.ToString(), property, value);
1513

1614
public IExecutableInstruction ToInstruction() => this;
1715

1816
protected override string ToStringInternal() =>
19-
$"{Left} = {@object}.{_property}";
17+
$"{Left} = {@object}.{property}";
2018
}

src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write;
55

6-
public class DotAssignment(string @object, IValue property, IValue value)
6+
public class DotAssignment(string @object, Constant property, IValue value)
77
: Simple(left: @object, (property, value), "."), IWriteToComplexData
88
{
99
public override IAddress? Execute(IExecuteParams executeParams)
@@ -19,7 +19,7 @@ public class DotAssignment(string @object, IValue property, IValue value)
1919
}
2020

2121
public Simple ToSimple() =>
22-
new DotRead(new Name(Left!), Right.left!);
22+
new DotRead(new Name(Left!), property);
2323

2424
protected override string ToStringInternal() =>
2525
$"{Left}.{Right.left} = {Right.right}";

0 commit comments

Comments
 (0)