Skip to content

Commit

Permalink
Create Unifier test: Unify(double, TypeReference(struct (0 double))) …
Browse files Browse the repository at this point in the history
…=> TypeReference(struct (0 double))

```
Expected: "STR"
But was:  "(union (real64 u1) (STR u0))"
```
  • Loading branch information
ptomin committed Jan 5, 2024
1 parent fb401fe commit 840abbf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/UnitTests/Decompiler/Typing/UnifierTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,17 @@ public void UnifyTypeReferences()
Assert.AreEqual("CHAR", un.Unify(t1, t2).ToString());
}

[Test]
public void UnifyDoubleWithFieldAt0OffsetOfTypeReferenceToStruct()
{
var t1 = new TypeReference("STR", new StructureType
{
Fields = { { 0, PrimitiveType.Real64 } }
});
var t2 = PrimitiveType.Real64;
Assert.AreEqual("STR", un.Unify(t1, t2).ToString());
}

[Test]
public void Unify_AreUnknownCompatible()
{
Expand Down

0 comments on commit 840abbf

Please sign in to comment.