diff --git a/nac3core/src/toplevel/composer.rs b/nac3core/src/toplevel/composer.rs index 5e86cb38..9e8edb88 100644 --- a/nac3core/src/toplevel/composer.rs +++ b/nac3core/src/toplevel/composer.rs @@ -2140,14 +2140,17 @@ impl TopLevelComposer { { let subkernel_dest = keywords.iter().find(|keyword| { if keyword.node.arg == Some("destination".into()) { - if let ExprKind::Constant { value, .. } = &keyword.node.value.node { - return true; + match &keyword.node.value.node { + ExprKind::Constant { .. } => true, + _ => false } + } else { + false } - false } ).node.value.node.value; - if let Some(Constant::Int(sk_dest)) == subkernel_dest { + // treat subkernel as kernel if the destination is the same as currently compiled + if let Some(Constant::Int(sk_dest)) = subkernel_dest { if sk_dest != destination.unwrap_or(0) { instance_to_symbol.insert(String::new(), simple_name.to_string()); }