Skip to content

Commit

Permalink
Merge pull request #3079 from tokiwa-software/redefinition_must_not_b…
Browse files Browse the repository at this point in the history
…e_choice

ast: fix check-failure if redefinition is a choice
  • Loading branch information
michaellilltokiwa committed May 17, 2024
2 parents f21db8d + 19315f7 commit 4d44eec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dev/flang/ast/AstErrors.java
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,12 @@ else if (existing.isChoice())
{
cannotRedefineChoice(f, existing);
}
else if (f.isChoice())
{
cannotRedefine(f.pos(), f, existing,
"Redefinition cannot be a choice",
"To solve this, re-think what you want to do. Maybe define a new choice type with a different name instead.");
}
else if (existing.isConstructor() || f.isConstructor())
{
cannotRedefine(f.pos(), f, existing,
Expand Down

0 comments on commit 4d44eec

Please sign in to comment.