mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Handle root type when loading from str
This commit is contained in:
parent
0283bd1d24
commit
4e5fdfbf52
12 changed files with 127 additions and 101 deletions
|
@ -104,12 +104,14 @@ pub fn load_and_monomorphize_from_str<'a>(
|
|||
filename: PathBuf,
|
||||
src: &'a str,
|
||||
src_dir: PathBuf,
|
||||
opt_main_path: Option<PathBuf>,
|
||||
roc_cache_dir: RocCacheDir<'_>,
|
||||
load_config: LoadConfig,
|
||||
) -> Result<MonomorphizedModule<'a>, LoadMonomorphizedError<'a>> {
|
||||
use LoadResult::*;
|
||||
|
||||
let load_start = LoadStart::from_str(arena, filename, src, roc_cache_dir, src_dir)?;
|
||||
let load_start =
|
||||
LoadStart::from_str(arena, filename, opt_main_path, src, roc_cache_dir, src_dir)?;
|
||||
let exposed_types = ExposedByModule::default();
|
||||
|
||||
match load(arena, load_start, exposed_types, roc_cache_dir, load_config)? {
|
||||
|
@ -176,6 +178,7 @@ pub fn load_and_typecheck_str<'a>(
|
|||
filename: PathBuf,
|
||||
source: &'a str,
|
||||
src_dir: PathBuf,
|
||||
opt_main_path: Option<PathBuf>,
|
||||
target: Target,
|
||||
function_kind: FunctionKind,
|
||||
render: RenderTarget,
|
||||
|
@ -184,7 +187,14 @@ pub fn load_and_typecheck_str<'a>(
|
|||
) -> Result<LoadedModule, LoadingProblem<'a>> {
|
||||
use LoadResult::*;
|
||||
|
||||
let load_start = LoadStart::from_str(arena, filename, source, roc_cache_dir, src_dir)?;
|
||||
let load_start = LoadStart::from_str(
|
||||
arena,
|
||||
filename,
|
||||
opt_main_path,
|
||||
source,
|
||||
roc_cache_dir,
|
||||
src_dir,
|
||||
)?;
|
||||
|
||||
// NOTE: this function is meant for tests, and so we use single-threaded
|
||||
// solving so we don't use too many threads per-test. That gives higher
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue