diff --git a/core/src/main/java/org/teavm/backend/wasm/gc/PreciseValueType.java b/core/src/main/java/org/teavm/backend/wasm/gc/PreciseValueType.java index d590e534a..092d17cb6 100644 --- a/core/src/main/java/org/teavm/backend/wasm/gc/PreciseValueType.java +++ b/core/src/main/java/org/teavm/backend/wasm/gc/PreciseValueType.java @@ -15,6 +15,7 @@ */ package org.teavm.backend.wasm.gc; +import java.util.Objects; import org.teavm.model.ValueType; public class PreciseValueType { @@ -25,4 +26,22 @@ public class PreciseValueType { this.valueType = valueType; this.isArrayUnwrap = isArrayUnwrap; } + + @Override + public final boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof PreciseValueType)) { + return false; + } + + var that = (PreciseValueType) o; + return isArrayUnwrap == that.isArrayUnwrap && valueType.equals(that.valueType); + } + + @Override + public int hashCode() { + return Objects.hash(valueType, isArrayUnwrap); + } }