mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Make sure FunctionKind is determined in all entry points
There are a lot of entry points for a Roc program. They should probably be all consolidated into one, but for now, when FunctionKind is needed, determine it from the environment. This fixes EXPERIMENTAL_ROC_ERASE for `roc test` etc. Also print the location of a failure when `internal_error!` is called. I think this should panic instead, and I thought it used to - does anyone know if that changed?
This commit is contained in:
parent
6869c9f2e1
commit
0e52a7e069
6 changed files with 31 additions and 25 deletions
|
@ -695,20 +695,9 @@ pub fn standard_load_config(
|
|||
BuildOrdering::AlwaysBuild => ExecutionMode::Executable,
|
||||
};
|
||||
|
||||
// UNSTABLE(lambda-erasure)
|
||||
let function_kind = if cfg!(debug_assertions) {
|
||||
if std::env::var("EXPERIMENTAL_ROC_ERASE").is_ok() {
|
||||
FunctionKind::Erased
|
||||
} else {
|
||||
FunctionKind::LambdaSet
|
||||
}
|
||||
} else {
|
||||
FunctionKind::LambdaSet
|
||||
};
|
||||
|
||||
LoadConfig {
|
||||
target,
|
||||
function_kind,
|
||||
function_kind: FunctionKind::from_env(),
|
||||
render: RenderTarget::ColorTerminal,
|
||||
palette: DEFAULT_PALETTE,
|
||||
threading,
|
||||
|
@ -1202,8 +1191,7 @@ pub fn check_file<'a>(
|
|||
|
||||
let load_config = LoadConfig {
|
||||
target,
|
||||
// TODO: we may not want this for just checking.
|
||||
function_kind: FunctionKind::LambdaSet,
|
||||
function_kind: FunctionKind::from_env(),
|
||||
// TODO: expose this from CLI?
|
||||
render: RenderTarget::ColorTerminal,
|
||||
palette: DEFAULT_PALETTE,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue