Skip to content

Commit

Permalink
Fix inferred type expressions (#1806)
Browse files Browse the repository at this point in the history
Co-authored-by: amylizzle <[email protected]>
Co-authored-by: wixoa <[email protected]>
  • Loading branch information
3 people authored May 24, 2024
1 parent 1785d5b commit f19fc85
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Content.Tests/DMProject/Tests/Expression/InferredType.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// issue #1752

/proc/RunTest()
var/matrix/M1 = new()
var/matrix/M2 = new()

(M1 * M2).Multiply(1)

var/list/test = list(M1,M2)
(locate(/matrix) in test).Multiply(1)
1 change: 1 addition & 0 deletions DMCompiler/DM/Expressions/Binary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ internal abstract class BinaryOp(Location location, DMExpression lhs, DMExpressi
protected DMExpression LHS { get; } = lhs;
protected DMExpression RHS { get; } = rhs;
public override DMComplexValueType ValType => LHS.ValType;
public override bool PathIsFuzzy => true;
}

#region Simple
Expand Down
1 change: 1 addition & 0 deletions DMCompiler/DM/Expressions/Builtins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public override void EmitPushValue(DMObject dmObject, DMProc proc) {
sealed class Locate : DMExpression {
private readonly DMExpression _path;
private readonly DMExpression? _container;
public override bool PathIsFuzzy => true;

public Locate(Location location, DMExpression path, DMExpression? container) : base(location) {
_path = path;
Expand Down

0 comments on commit f19fc85

Please sign in to comment.