From 5a8ac1559c9fc597e6dcb29f64a55da8763ba9c9 Mon Sep 17 00:00:00 2001 From: Michael Lill Date: Fri, 3 Nov 2023 12:17:44 +0100 Subject: [PATCH] add pre-condition, not adding fixed features to inherited features --- src/dev/flang/fe/Module.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dev/flang/fe/Module.java b/src/dev/flang/fe/Module.java index cd0c7f09f..05e7679f8 100644 --- a/src/dev/flang/fe/Module.java +++ b/src/dev/flang/fe/Module.java @@ -28,7 +28,6 @@ import dev.flang.ast.AbstractFeature; import dev.flang.ast.AstErrors; -import dev.flang.ast.Consts; import dev.flang.ast.FeatureName; import dev.flang.ast.State; import dev.flang.ast.Types; @@ -214,7 +213,7 @@ void findInheritedFeatures(SortedMap set, Abstract if (CHECKS) check (cf != outer); - if ((f.modifiers() & Consts.MODIFIER_FIXED) == 0) + if (!f.isFixed()) { var newfn = cf.handDown(null, f, fn, p, outer); addInheritedFeature(set, outer, p, newfn, f); @@ -254,6 +253,9 @@ void addInheritedFeature(SortedMap set, FeatureName fn, AbstractFeature f) { + if (PRECONDITIONS) + require(!f.isFixed()); + var existing = set.get(fn); if (existing != null) {