fix some bugs

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-04-07 14:43:25 -07:00
parent ec3f6d5e3c
commit 4777ea8e64
3 changed files with 3 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 216 KiB

View File

@ -722,7 +722,7 @@ impl ExecutorContext {
exec_state: &mut ExecState, exec_state: &mut ExecState,
preserve_mem: bool, preserve_mem: bool,
) -> Result<(EnvironmentRef, Option<ModelingSessionData>), KclErrorWithOutputs> { ) -> Result<(EnvironmentRef, Option<ModelingSessionData>), KclErrorWithOutputs> {
self.prepare_mem(exec_state).await.unwrap(); self.prepare_mem(exec_state).await?;
let mut universe = std::collections::HashMap::new(); let mut universe = std::collections::HashMap::new();

View File

@ -179,13 +179,13 @@ pub(crate) async fn import_universe(
let Some(module_info) = exec_state.get_module(module_id) else { let Some(module_info) = exec_state.get_module(module_id) else {
return Err(KclError::Internal(KclErrorDetails { return Err(KclError::Internal(KclErrorDetails {
message: format!("Module {} not found", module_id), message: format!("Module {} not found", module_id),
source_ranges: Default::default(), source_ranges: vec![import_stmt.into()],
})); }));
}; };
let ModuleRepr::Kcl(program, _) = &module_info.repr else { let ModuleRepr::Kcl(program, _) = &module_info.repr else {
return Err(KclError::Internal(KclErrorDetails { return Err(KclError::Internal(KclErrorDetails {
message: format!("Module {} is not a KCL module", module_id), message: format!("Module {} is not a KCL module", module_id),
source_ranges: Default::default(), source_ranges: vec![import_stmt.into()],
})); }));
}; };
program.clone() program.clone()