From 9f771c84ab1d4782852c19c0cf993e1c6e544401 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 13 Jan 2024 17:20:54 +0000 Subject: Preserve ordering of supertypes --- src/main/java/org/shedlang/compiler/typechecker/TypeInfos.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') 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 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()) -- cgit v1.2.3