-
-
Notifications
You must be signed in to change notification settings - Fork 154
Closed
Labels
languageLanguage featureLanguage feature
Milestone
Description
hi there, I've got a compiler crash with a case like this:
fun toggleTheme : Promise(Void) {
let currentTheme = Dom.getAttribute(`document.documentElement`, "data-theme")
let newTheme =
case currentTheme {
"light" => "dark"
"dark" => "light"
_ => "dark"
}
}
Originally, I had a couple of guesses but... oh yeah it's about the underscore in the last case. A habit coming from other languages.
SCOPE!!!: Mint::Ast::Discard (Exception)
from mint in 'raise<Exception>:NoReturn'
from mint in 'raise<String>:NoReturn'
from mint in 'Mint::Scope#build<(Mint::Ast::Node+ | Nil), Mint::Ast::CaseBranch>:(Mint::Ast::Node+ | Mint::Scope::Target | Nil)'
from mint in 'Mint::Scope#build<Array(Mint::Ast::CaseBranch), Mint::Ast::Case>:(Mint::Ast::Node+ | Nil)'
from mint in 'Mint::Scope#build<Mint::Ast::Node+, Mint::Ast::Node+>:(Mint::Ast::Node+ | Mint::Scope::Target | Nil)'
from mint in 'Mint::Scope#build<Mint::Ast::Block, Mint::Ast::Function>:(Mint::Ast::Node+ | Nil)'
from mint in 'Mint::Scope#build<Mint::Ast::Node+>:(Mint::Ast::Node+ | Mint::Scope::Target | Nil)'
from mint in 'Mint::TypeChecker::Artifacts::new<Mint::Ast>:Mint::TypeChecker::Artifacts'
from mint in 'Mint::Workspace#update<Array(String), Symbol>:(Set(Tuple(String, Time)) | Nil)'
from mint in 'Mint::Watcher#scan<Symbol>:Set(Tuple(String, Time))'
from mint in 'Mint::Workspace#reset:(Set(Tuple(String, Time)) | Nil)'
from mint in 'Mint::Workspace::new:path:dot_env:check:include_tests:format:listener<String, String, Mint::Check, Bool, Bool, Proc((Mint::Error | Mint::TypeChecker), Nil)>:Mint::Workspace'
from mint in 'Mint::Cli::Start#parse_and_run:Nil'
from mint in 'Mint::Cli#parse_and_run:Nil'
from mint in '__crystal_main'
from mint in 'main'
I am not sure what should happen when someone puts underscore there. Should be disregarded (then introducing 2 ways of supporting the "else" case)? Or treated as a compile error?
Metadata
Metadata
Assignees
Labels
languageLanguage featureLanguage feature