Skip to content

Commit

Permalink
add pre-condition, not adding fixed features to inherited features
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellilltokiwa committed Nov 3, 2023
1 parent bc589da commit 5a8ac15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dev/flang/fe/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -214,7 +213,7 @@ void findInheritedFeatures(SortedMap<FeatureName, AbstractFeature> 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);
Expand Down Expand Up @@ -254,6 +253,9 @@ void addInheritedFeature(SortedMap<FeatureName, AbstractFeature> set,
FeatureName fn,
AbstractFeature f)
{
if (PRECONDITIONS)
require(!f.isFixed());

var existing = set.get(fn);
if (existing != null)
{
Expand Down

0 comments on commit 5a8ac15

Please sign in to comment.