aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-01-13 17:20:54 +0000
committerMichael Williamson <mike@zwobble.org>2024-01-13 17:20:54 +0000
commit9f771c84ab1d4782852c19c0cf993e1c6e544401 (patch)
tree4293323bc26c90083ad19f9403aeba4aa178066c /src/main/java
parent298f03e167d4cf3ef5b5088f355c8d8e4ee21467 (diff)
Preserve ordering of supertypes
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/shedlang/compiler/typechecker/TypeInfos.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/shedlang/compiler/typechecker/TypeInfos.java b/src/main/java/org/shedlang/compiler/typechecker/TypeInfos.java
index 3910b472..4a49cd48 100644
--- a/src/main/java/org/shedlang/compiler/typechecker/TypeInfos.java
+++ b/src/main/java/org/shedlang/compiler/typechecker/TypeInfos.java
@@ -135,7 +135,7 @@ public class TypeInfos {
* Get the supertypes of a type, from most specific to least specific.
*/
public Set<Type> supertypes(Type type) {
- var supertypes = P.set(type);
+ var supertypes = P.orderedSet(type);
if (type instanceof StructType structType) {
supertypes = supertypes.plusAll(
this.structSupertypes.getOrDefault(structType, P.orderedSet())