Skip to content

Commit

Permalink
Merge pull request #4605 from michaellilltokiwa/ast--fix-#4418,-suppr…
Browse files Browse the repository at this point in the history
…ess-extra-errors

ast: fix #4418, suppress extra errors
  • Loading branch information
michaellilltokiwa authored Jan 14, 2025
2 parents 9f65968 + 0904f73 commit 86a6044
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dev/flang/ast/Match.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void resolveTypes(Resolution res, Context context)
{
res.resolveTypes(st.feature());
}
if (st.isChoice())
if (st.isChoice() && Types.resolved.t_void != st)
{
var cgs = st.choiceGenerics(context);
for (var i = 0; i < cgs.size(); i++)
Expand Down
25 changes: 25 additions & 0 deletions tests/reg_issue4418/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file is part of the Fuzion language implementation.
#
# The Fuzion language implementation is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, version 3 of the License.
#
# The Fuzion language implementation is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License along with The
# Fuzion language implementation. If not, see <https://www.gnu.org/licenses/>.


# -----------------------------------------------------------------------
#
# Tokiwa Software GmbH, Germany
#
# Source code of Fuzion test Makefile
#
# -----------------------------------------------------------------------

override NAME = reg_issue4418
include ../simple.mk
26 changes: 26 additions & 0 deletions tests/reg_issue4418/reg_issue4418.fz
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file is part of the Fuzion language implementation.
#
# The Fuzion language implementation is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, version 3 of the License.
#
# The Fuzion language implementation is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License along with The
# Fuzion language implementation. If not, see <https://www.gnu.org/licenses/>.


# -----------------------------------------------------------------------
#
# Tokiwa Software GmbH, Germany
#
# Source code of Fuzion test reg_issue4418
#
# -----------------------------------------------------------------------

test(s) => match s.first
nil => true
* => false
7 changes: 7 additions & 0 deletions tests/reg_issue4418/reg_issue4418.fz.expected_err
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

--CURDIR--/reg_issue4418.fz:24:6: error 1: Type inference from actual arguments failed since no actual call was found
test(s) => match s.first
-----^
For the formal argument 'test.s' the type can only be derived if there is a call to 'test'.

one error.
Empty file.

0 comments on commit 86a6044

Please sign in to comment.