diff --git a/src/dev/flang/be/jvm/Choices.java b/src/dev/flang/be/jvm/Choices.java index 1ff74d8e89..099e3d9830 100644 --- a/src/dev/flang/be/jvm/Choices.java +++ b/src/dev/flang/be/jvm/Choices.java @@ -788,12 +788,11 @@ Expr tag(JVM jvm, int s, Expr value, int newcl, int tagNum) fn, ft)); } - res = res.is(_types.javaType(newcl)); break; } default: throw new Error("Unexpected choice kind in tag of JVM backend: " + kind(newcl)); } - return res; + return res.is(_types.javaType(newcl)); } diff --git a/tests/reg_issue3757/Makefile b/tests/reg_issue3757/Makefile new file mode 100644 index 0000000000..8d78104d47 --- /dev/null +++ b/tests/reg_issue3757/Makefile @@ -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 . + + +# ----------------------------------------------------------------------- +# +# Tokiwa Software GmbH, Germany +# +# Source code of Fuzion test Makefile +# +# ----------------------------------------------------------------------- + +override NAME = reg_issue3757 +include ../simple.mk diff --git a/tests/reg_issue3757/reg_issue3757.fz b/tests/reg_issue3757/reg_issue3757.fz new file mode 100644 index 0000000000..b588cf563c --- /dev/null +++ b/tests/reg_issue3757/reg_issue3757.fz @@ -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 . + + +# ----------------------------------------------------------------------- +# +# Tokiwa Software GmbH, Germany +# +# Source code of Fuzion test reg_issue3757 +# +# ----------------------------------------------------------------------- + +my_string : String is +my_choice2 : choice String my_string is +mc2 my_choice2 := "str" diff --git a/tests/reg_issue3757/reg_issue3757.fz.expected_err b/tests/reg_issue3757/reg_issue3757.fz.expected_err new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/reg_issue3757/reg_issue3757.fz.expected_out b/tests/reg_issue3757/reg_issue3757.fz.expected_out new file mode 100644 index 0000000000..e69de29bb2