Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fallthrough not compiling #424

Open
BSteffaniak opened this issue Aug 25, 2022 · 0 comments
Open

fallthrough not compiling #424

BSteffaniak opened this issue Aug 25, 2022 · 0 comments

Comments

@BSteffaniak
Copy link
Member

public static async boolQuestion(
String value,
String invalidResponseMessage = null
) =>
Bool.fromString(question(
  value,
  {
    let response = match _.toLowerCase() {
      "y" => fallthrough
      "yes" => fallthrough
      "n" => fallthrough
      "no" => true
      default => false
    }

    return response
  },
  {
    let response = match _ {
      "y" => fallthrough
      "yes" => "true"
      "n" => fallthrough
      "no" => "false"
      default => "false"
    }

    return response
  },
  invalidResponseMessage ?: "Invalid answer. Please respond with 'y' or 'n'"
))

Error: Invalid case value 'fallthrough' for expression - in file "flat/readline/ReadLine.flat" on line number 5 at offset 0 [15, 36]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant