Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
12612bf
Start working on a tool to show code after macro expansions
asterite Mar 6, 2025
b7aab10
Move printing code to a Printer type
asterite Mar 7, 2025
f87c0f4
Show structs
asterite Mar 7, 2025
f0436a2
Also move `show_module` to printer
asterite Mar 7, 2025
f79d35d
Nested modules and cleaner output
asterite Mar 7, 2025
67ad4fb
Sort definitions
asterite Mar 7, 2025
170ed2c
Show globals
asterite Mar 7, 2025
c364c58
Anticipate showing types will be more complex than just `to_string()`
asterite Mar 7, 2025
8a8516f
Show type aliases
asterite Mar 7, 2025
741a293
Show traits (without methods yet)
asterite Mar 7, 2025
12bc89c
Show trait functions
asterite Mar 7, 2025
c4fffeb
Show function where clause
asterite Mar 7, 2025
42771d8
Show enums
asterite Mar 7, 2025
3ab7ac6
clippy
asterite Mar 7, 2025
3803c9c
Merge branch 'master' into ab/macro-expander
asterite Mar 7, 2025
ea428c5
Show comptime structs
asterite Mar 7, 2025
9518e99
Show comptime tuples
asterite Mar 7, 2025
a36de4e
Show comptime arrays
asterite Mar 7, 2025
b01cc4c
Show slices
asterite Mar 7, 2025
b8fe29b
mod vs contract
asterite Mar 7, 2025
af0560f
Show comptime CtString
asterite Mar 7, 2025
b044113
Show quoted values
asterite Mar 7, 2025
3483817
Show format strings
asterite Mar 7, 2025
658b51d
Show comptime function references
asterite Mar 7, 2025
c7620c2
Show comptime enum values
asterite Mar 7, 2025
9fe171d
check_package -> expand_package
asterite Mar 7, 2025
eeb0cff
Start showing impl methods
asterite Mar 7, 2025
0269ba4
Show impl generics
asterite Mar 7, 2025
b8acd24
Remove unused parameter
asterite Mar 7, 2025
d552c53
Show trait impls next to trait, for primitive types
asterite Mar 7, 2025
e243934
We actually need to show trait impls for non-primitive types too
asterite Mar 7, 2025
0acf35a
Show all trait impls
asterite Mar 7, 2025
340f946
clippy
asterite Mar 7, 2025
8d783f4
Apparently not all functions store a block
asterite Mar 7, 2025
faecd5a
Some comptime values are impossible to represent
asterite Mar 7, 2025
df3d8f6
Merge branch 'master' into ab/macro-expander
asterite Mar 7, 2025
a27c087
Fix after merge
asterite Mar 7, 2025
4b516a2
Don't use `to_display_ast`
asterite Mar 10, 2025
b1fdb3f
Better way to show if
asterite Mar 10, 2025
aeb3c8a
No need for indent before mod/contract
asterite Mar 10, 2025
41e6a69
Remove extra spaces for `quote {}`
asterite Mar 10, 2025
2e39525
Show `quote {}` with correct indentation
asterite Mar 10, 2025
7b5acba
Show doc comments
asterite Mar 10, 2025
d577751
Merge branch 'master' into ab/macro-expander
asterite Mar 10, 2025
41eed63
Show imports
asterite Mar 10, 2025
71b98e1
Some fixes
asterite Mar 10, 2025
2e517e4
More fixes
asterite Mar 10, 2025
0b2ef43
Format generated code if possible
asterite Mar 10, 2025
0a3cd78
Fix: correctly show data type name
asterite Mar 10, 2025
139ab9a
Show attributes
asterite Mar 10, 2025
7e1d71d
Show unsafe comment on top of let
asterite Mar 10, 2025
3acf1b1
Merge imports
asterite Mar 10, 2025
8c072a5
Fix showing parent traits
asterite Mar 10, 2025
f1ccb41
Fully-qualify hir idents if needed
asterite Mar 10, 2025
549ca30
Show calls as methods if possible
asterite Mar 10, 2025
67e2c1d
Allow method calls after statement block (like Rust)
asterite Mar 10, 2025
ef81405
Use a different kind of comment because of a formatter bug
asterite Mar 10, 2025
10654f0
Fully-qualify types if needed
asterite Mar 10, 2025
b1cd852
Surround with parentheses just in case
asterite Mar 10, 2025
31937e7
clippy
asterite Mar 10, 2025
00fd6ee
Function types always mention a return type
asterite Mar 11, 2025
8ee6680
Tool comment
asterite Mar 11, 2025
9720da9
Remove duplicate function
asterite Mar 11, 2025
ad8643e
Escape strings in fmtstr
asterite Mar 11, 2025
bef6a9f
Remove unneeded TODOs
asterite Mar 11, 2025
4c6f533
Improve safety comments
asterite Mar 11, 2025
0a8cfaa
Replace spaces in internal variable names
asterite Mar 11, 2025
02c0368
clippy
asterite Mar 11, 2025
f5d010e
Handle match
asterite Mar 11, 2025
9bfaa2d
Correct indent for block doc comments
asterite Mar 11, 2025
5de2ae6
Reorganize code
asterite Mar 11, 2025
d5af25f
Merge branch 'master' into ab/macro-expander
asterite Mar 11, 2025
2d156f3
Undo change in Cargo.lock
asterite Mar 11, 2025
ab20f5b
Remove rustc-hash dependency
asterite Mar 11, 2025
817618a
Merge branch 'master' into ab/macro-expander
asterite Mar 11, 2025
adb8387
Fix after merge
asterite Mar 11, 2025
2f52ce6
Try to omit extra parentheses if possible
asterite Mar 11, 2025
4ad5a16
Try to omit parentheses in type expressions too
asterite Mar 11, 2025
31397cb
Consider parens in method calls
asterite Mar 11, 2025
8cc758b
Improve quote output
asterite Mar 11, 2025
cc3d5b3
Add a smoke test
asterite Mar 11, 2025
31da411
Simplify so we don't have DefMap in addition to DefMaps
asterite Mar 11, 2025
6ceeb0c
Fix extra parentheses printed
asterite Mar 11, 2025
50411e2
Split item building from item printing
asterite Mar 11, 2025
2691ad3
fix: show impl methods visibility and docs
asterite Mar 11, 2025
685580e
Also show docs for trait methods and trait impl methods
asterite Mar 11, 2025
5775432
clippy
asterite Mar 11, 2025
0fe4cd7
Reduce visibility of some methods
asterite Mar 11, 2025
502f977
Explain `trait_impls`
asterite Mar 11, 2025
4217df4
Merge branch 'master' into ab/macro-expander
asterite Mar 12, 2025
ad4c041
Use line comment for safety comment
asterite Mar 12, 2025
59d19c3
Fix struct pattern in match
asterite Mar 12, 2025
1a62202
Handle TraitAsType
asterite Mar 12, 2025
3bfff61
Fix missing semicolon sometimes
asterite Mar 12, 2025
a68dfe3
More enums fixes
asterite Mar 12, 2025
ab6f2cc
fix: missing parentheses in cast expression
asterite Mar 12, 2025
517027d
Missing generics in method call
asterite Mar 12, 2025
bd69574
fix reference to module
asterite Mar 12, 2025
f346a02
Missing parentheses in member access
asterite Mar 12, 2025
20f1a9f
Always put parenthese before `*` in lvalue
asterite Mar 12, 2025
9c49a6d
Let comptime print always print to STDERR
asterite Mar 12, 2025
df042bf
Keep track of whether derefs where implicitly added in l-values
asterite Mar 12, 2025
4b4f2a9
fix: missing show generics with their kinds
asterite Mar 12, 2025
fef7e4e
Show comptime closures
asterite Mar 12, 2025
4ffc9e9
Missing curlies and parens
asterite Mar 12, 2025
e24ffe7
Sort impl methods by their location
asterite Mar 12, 2025
aa29af8
Assumed trait methods
asterite Mar 12, 2025
d149dc0
Missing gathering type vars from string type
asterite Mar 12, 2025
2164cae
Handle type paths
asterite Mar 12, 2025
f4e0fe9
clippy
asterite Mar 12, 2025
4c98ceb
Handle calls to member access
asterite Mar 12, 2025
94fe7fc
Remove dbg
asterite Mar 12, 2025
1bab7f5
Fix trait methods
asterite Mar 12, 2025
0b75477
Show trait impl associated types
asterite Mar 12, 2025
9a2d50f
Skip unbound named generics
asterite Mar 12, 2025
16f3d7c
Fix `type_mentions_data_type`
asterite Mar 12, 2025
a90a23c
Show tuple and struct patterns
asterite Mar 12, 2025
453a87d
fix: globals pointing to enum values
asterite Mar 12, 2025
a81c8b4
Try to use Self type
asterite Mar 12, 2025
566ddde
Fix for method on trait self
asterite Mar 12, 2025
e37405c
Use fully-qualified name to trait in trait impl
asterite Mar 12, 2025
74d6626
Check `nargo expand` on `test_programs/execution_success`
asterite Mar 13, 2025
50b79d6
Also add `nargo expand` tests for test_programs that compile fine
asterite Mar 13, 2025
b1b27a5
Merge branch 'master' into ab/macro-expander
asterite Mar 14, 2025
9de0182
Revert change to comptime printing, instead disable it in tests
asterite Mar 14, 2025
ce2927c
Correct way to disable comptime printing in tests
asterite Mar 14, 2025
9f23a26
Merge branch 'master' into ab/macro-expander
asterite Mar 25, 2025
ce574a0
Fixes after merge
asterite Mar 25, 2025
8099ad8
Merge branch 'master' into ab/macro-expander
asterite Mar 26, 2025
3e0dd9b
Fix after merge
asterite Mar 26, 2025
18c0e2c
Merge branch 'master' into ab/macro-expander
asterite Mar 28, 2025
99f7b7c
clippy
asterite Mar 31, 2025
07a6bde
Merge branch 'master' into ab/macro-expander
asterite Mar 31, 2025
669387e
More clippy
asterite Mar 31, 2025
cd00ebd
Merge branch 'master' into ab/macro-expander
asterite Apr 1, 2025
f20f0bb
Merge branch 'master' into ab/macro-expander
asterite Apr 21, 2025
5d7fc92
Fixes after merge
asterite Apr 21, 2025
af23e8f
Move methods to `execute`, and ignore more tests
asterite Apr 22, 2025
8c5cd03
Don't output unit function return type now that that's supported
asterite Apr 22, 2025
6c1babe
`--pedantic-solving` for tests
asterite Apr 29, 2025
84866a3
Improved comments
asterite Apr 29, 2025
aa7e855
Run `nargo fmt` on the expanded code too
asterite Apr 29, 2025
4224199
Extract `show_separated_by_comma`
asterite Apr 29, 2025
4a32986
Merge branch 'master' into ab/macro-expander
asterite Apr 29, 2025
7464534
todo! -> unreachable!
asterite Apr 29, 2025
8f2884c
Fixes after merge
asterite Apr 29, 2025
14b9608
parens -> curlies
asterite Apr 29, 2025
21c594b
Expect all modules to have a name
asterite Apr 29, 2025
4b7d0f8
Ignore a couple more tests
asterite Apr 29, 2025
6636b32
And a couple more...
asterite Apr 29, 2025
832552a
Add a comment about why we always output `*(...)`
asterite Apr 29, 2025
f162d01
Remove the smoke test
asterite Apr 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions compiler/noirc_frontend/src/elaborator/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -955,11 +955,18 @@ impl<'elab, 'ctx> MatchCompiler<'elab, 'ctx> {
variable_types: Vec<Type>,
location: Location,
) -> Vec<DefinitionId> {
vecmap(variable_types, |typ| self.fresh_match_variable(typ, location))
vecmap(variable_types.into_iter().enumerate(), |(index, typ)| {
self.fresh_match_variable(index, typ, location)
})
}

fn fresh_match_variable(&mut self, variable_type: Type, location: Location) -> DefinitionId {
let name = "internal_match_variable".to_string();
fn fresh_match_variable(
&mut self,
index: usize,
variable_type: Type,
location: Location,
) -> DefinitionId {
let name = format!("internal_match_variable_{index}");
let kind = DefinitionKind::Local(None);
let id = self.elaborator.interner.push_definition(name, false, false, kind, location);
self.elaborator.interner.push_definition_type(id, variable_type);
Expand Down
2 changes: 2 additions & 0 deletions compiler/noirc_frontend/src/elaborator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1573,10 +1573,12 @@ impl<'context> Elaborator<'context> {

let resolved_trait_impl = Shared::new(TraitImpl {
ident,
location,
typ: self_type.clone(),
trait_id,
trait_generics,
file: trait_impl.file_id,
crate_id: self.crate_id,
where_clause,
methods,
});
Expand Down
23 changes: 18 additions & 5 deletions compiler/noirc_frontend/src/elaborator/statements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,12 @@ impl Elaborator<'_> {
let tmp_value = HirLValue::Ident(ident, Type::Error);

let lvalue = std::mem::replace(object_ref, Box::new(tmp_value));
*object_ref =
Box::new(HirLValue::Dereference { lvalue, element_type, location });
*object_ref = Box::new(HirLValue::Dereference {
lvalue,
element_type,
location,
implicitly_added: true,
});
*mutable_ref = true;
};

Expand Down Expand Up @@ -442,8 +446,12 @@ impl Elaborator<'_> {
// as needed to unwrap any `&` or `&mut` wrappers.
while let Type::Reference(element, _) = lvalue_type.follow_bindings() {
let element_type = element.as_ref().clone();
lvalue =
HirLValue::Dereference { lvalue: Box::new(lvalue), element_type, location };
lvalue = HirLValue::Dereference {
lvalue: Box::new(lvalue),
element_type,
location,
implicitly_added: true,
};
lvalue_type = *element;
// We know this value to be mutable now since we found an `&mut`
mutable = true;
Expand Down Expand Up @@ -496,7 +504,12 @@ impl Elaborator<'_> {

// Dereferences are always mutable since we already type checked against a &mut T
let typ = element_type.clone();
let lvalue = HirLValue::Dereference { lvalue, element_type, location };
let lvalue = HirLValue::Dereference {
lvalue,
element_type,
location,
implicitly_added: false,
};
(lvalue, typ, true)
}
LValue::Interned(id, location) => {
Expand Down
12 changes: 10 additions & 2 deletions compiler/noirc_frontend/src/hir/comptime/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,16 @@ impl Display for TokensPrettyPrinter<'_, '_> {
}
}

pub(super) fn tokens_to_string(tokens: &[LocatedToken], interner: &NodeInterner) -> String {
TokensPrettyPrinter { tokens, interner, indent: 0 }.to_string()
pub fn tokens_to_string(tokens: &[LocatedToken], interner: &NodeInterner) -> String {
tokens_to_string_with_indent(tokens, 0, interner)
}

pub fn tokens_to_string_with_indent(
tokens: &[LocatedToken],
indent: usize,
interner: &NodeInterner,
) -> String {
TokensPrettyPrinter { tokens, interner, indent }.to_string()
}

/// Tries to print tokens in a way that it'll be easier for the user to understand a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ impl HirLValue {
let index = index.to_display_ast(interner);
LValue::Index { array, index, location: *location }
}
HirLValue::Dereference { lvalue, element_type: _, location } => {
HirLValue::Dereference { lvalue, element_type: _, location, implicitly_added: _ } => {
let lvalue = Box::new(lvalue.to_display_ast(interner));
LValue::Dereference(lvalue, *location)
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/noirc_frontend/src/hir/comptime/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
}
} else {
let name = self.elaborator.interner.function_name(&function);
unreachable!("Non-builtin, lowlevel or oracle builtin fn '{name}'")

Check warning on line 260 in compiler/noirc_frontend/src/hir/comptime/interpreter.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (lowlevel)
}
}

Expand Down Expand Up @@ -1111,7 +1111,7 @@
fn store_lvalue(&mut self, lvalue: HirLValue, rhs: Value) -> IResult<()> {
match lvalue {
HirLValue::Ident(ident, typ) => self.mutate(ident.id, rhs, ident.location),
HirLValue::Dereference { lvalue, element_type: _, location } => {
HirLValue::Dereference { lvalue, element_type: _, location, implicitly_added: _ } => {
match self.evaluate_lvalue(&lvalue)? {
Value::Pointer(value, _, _) => {
*value.borrow_mut() = rhs;
Expand Down Expand Up @@ -1172,7 +1172,7 @@
Value::Pointer(elem, true, _) => Ok(elem.borrow().clone()),
other => Ok(other),
},
HirLValue::Dereference { lvalue, element_type, location } => {
HirLValue::Dereference { lvalue, element_type, location, implicitly_added: _ } => {
match self.evaluate_lvalue(lvalue)? {
Value::Pointer(value, _, _) => Ok(value.borrow().clone()),
value => {
Expand Down
1 change: 1 addition & 0 deletions compiler/noirc_frontend/src/hir/comptime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod interpreter;
mod tests;
mod value;

pub use display::{tokens_to_string, tokens_to_string_with_indent};
pub use errors::{ComptimeError, InterpreterError};
pub use interpreter::Interpreter;
pub use value::Value;
1 change: 1 addition & 0 deletions compiler/noirc_frontend/src/hir_def/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ pub enum HirLValue {
Dereference {
lvalue: Box<HirLValue>,
element_type: Type,
implicitly_added: bool,
location: Location,
},
}
2 changes: 2 additions & 0 deletions compiler/noirc_frontend/src/hir_def/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ pub struct Trait {
#[derive(Debug)]
pub struct TraitImpl {
pub ident: Ident,
pub location: Location,
pub typ: Type,
pub trait_id: TraitId,

Expand All @@ -95,6 +96,7 @@ pub struct TraitImpl {
pub trait_generics: Vec<Type>,

pub file: FileId,
pub crate_id: CrateId,
pub methods: Vec<FuncId>, // methods[i] is the implementation of trait.methods[i] for Type typ

/// The where clause, if present, contains each trait requirement which must
Expand Down
1 change: 1 addition & 0 deletions compiler/noirc_frontend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub mod elaborator;
pub mod graph;
pub mod lexer;
pub mod locations;
pub mod modules;
pub mod monomorphization;
pub mod node_interner;
pub mod ownership;
Expand Down
211 changes: 211 additions & 0 deletions compiler/noirc_frontend/src/modules.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
use crate::{
ast::Ident,
graph::{CrateId, Dependency},
hir::def_map::{ModuleDefId, ModuleId},
node_interner::{NodeInterner, ReferenceId},
};

pub fn get_parent_module(interner: &NodeInterner, module_def_id: ModuleDefId) -> Option<ModuleId> {
let reference_id = module_def_id_to_reference_id(module_def_id);
interner.reference_module(reference_id).copied()
}

pub fn module_def_id_to_reference_id(module_def_id: ModuleDefId) -> ReferenceId {
match module_def_id {
ModuleDefId::ModuleId(id) => ReferenceId::Module(id),
ModuleDefId::FunctionId(id) => ReferenceId::Function(id),
ModuleDefId::TypeId(id) => ReferenceId::Type(id),
ModuleDefId::TypeAliasId(id) => ReferenceId::Alias(id),
ModuleDefId::TraitId(id) => ReferenceId::Trait(id),
ModuleDefId::GlobalId(id) => ReferenceId::Global(id),
}
}

/// Returns the fully-qualified path of the given `ModuleDefId` relative to `current_module_id`:
/// - If `ModuleDefId` is a module, that module's path is returned
/// - Otherwise, that item's parent module's path is returned
pub fn relative_module_full_path(
module_def_id: ModuleDefId,
current_module_id: ModuleId,
current_module_parent_id: Option<ModuleId>,
interner: &NodeInterner,
) -> Option<String> {
let full_path;
if let ModuleDefId::ModuleId(module_id) = module_def_id {
full_path = relative_module_id_path(
module_id,
current_module_id,
current_module_parent_id,
interner,
);
} else {
let parent_module = get_parent_module(interner, module_def_id)?;

// If module_def_id is contained in the current module, the relative path is empty
if current_module_id == parent_module {
return None;
}

full_path = relative_module_id_path(
parent_module,
current_module_id,
current_module_parent_id,
interner,
);
}
Some(full_path)
}

/// Returns the path to reach an item inside `target_module_id` from inside `current_module_id`.
/// Returns a relative path if possible.
pub fn relative_module_id_path(
target_module_id: ModuleId,
current_module_id: ModuleId,
current_module_parent_id: Option<ModuleId>,
interner: &NodeInterner,
) -> String {
if Some(target_module_id) == current_module_parent_id {
return "super".to_string();
}

let mut segments: Vec<&str> = Vec::new();
let mut is_relative = false;

if let Some(module_attributes) = interner.try_module_attributes(&target_module_id) {
segments.push(&module_attributes.name);

let mut current_attributes = module_attributes;
loop {
let Some(parent_local_id) = current_attributes.parent else {
break;
};

let parent_module_id =
&ModuleId { krate: target_module_id.krate, local_id: parent_local_id };

if current_module_id == *parent_module_id {
is_relative = true;
break;
}

if current_module_parent_id == Some(*parent_module_id) {
segments.push("super");
is_relative = true;
break;
}

let Some(parent_attributes) = interner.try_module_attributes(parent_module_id) else {
break;
};

segments.push(&parent_attributes.name);
current_attributes = parent_attributes;
}
}

if !is_relative {
// We don't record module attributes for the root module,
// so we handle that case separately
if target_module_id.krate.is_root() {
segments.push("crate");
}
}

segments.reverse();
segments.join("::")
}

pub fn module_full_path(
module: &ModuleId,
interner: &NodeInterner,
crate_id: CrateId,
crate_name: &str,
dependencies: &Vec<Dependency>,
) -> String {
let mut segments: Vec<String> = Vec::new();

if let Some(module_attributes) = interner.try_module_attributes(module) {
segments.push(module_attributes.name.clone());

let mut current_attributes = module_attributes;
loop {
let Some(parent_local_id) = current_attributes.parent else {
break;
};

let Some(parent_attributes) = interner.try_module_attributes(&ModuleId {
krate: module.krate,
local_id: parent_local_id,
}) else {
break;
};

segments.push(parent_attributes.name.clone());
current_attributes = parent_attributes;
}
}

// We don't record module attributes for the root module,
// so we handle that case separately
if module.krate.is_root() {
if module.krate == crate_id {
segments.push(crate_name.to_string());
} else {
for dep in dependencies {
if dep.crate_id == crate_id {
segments.push(dep.name.to_string());
break;
}
}
}
};

segments.reverse();
segments.join("::")
}

/// Returns the relative path to reach `module_def_id` named `name` starting from `current_module_id`.
///
/// - `defining_module` might be `Some` if the item is reexported from another module
/// - `intermediate_name` might be `Some` if the item's parent module is reexport from another module
/// (this will be the name of the reexport)
///
/// Returns `None` if `module_def_id` isn't visible from the current module, neither directly, neither via
/// any of its reexports (or parent module reexports).
pub fn module_def_id_relative_path(
module_def_id: ModuleDefId,
name: &str,
current_module_id: ModuleId,
current_module_parent_id: Option<ModuleId>,
defining_module: Option<ModuleId>,
intermediate_name: &Option<Ident>,
interner: &NodeInterner,
) -> Option<String> {
let module_path = if let Some(defining_module) = defining_module {
relative_module_id_path(
defining_module,
current_module_id,
current_module_parent_id,
interner,
)
} else {
relative_module_full_path(
module_def_id,
current_module_id,
current_module_parent_id,
interner,
)?
};

let path = if defining_module.is_some() || !matches!(module_def_id, ModuleDefId::ModuleId(..)) {
if let Some(reexport_name) = &intermediate_name {
format!("{}::{}::{}", module_path, reexport_name, name)
} else {
format!("{}::{}", module_path, name)
}
} else {
module_path.clone()
};

Some(path)
}
2 changes: 1 addition & 1 deletion compiler/noirc_frontend/src/monomorphization/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@ impl<'interner> Monomorphizer<'interner> {
let element_type = Self::convert_type(&typ, location)?;
ast::LValue::Index { array, index, element_type, location }
}
HirLValue::Dereference { lvalue, element_type, location } => {
HirLValue::Dereference { lvalue, element_type, location, implicitly_added: _ } => {
let reference = Box::new(self.lvalue(*lvalue)?);
let element_type = Self::convert_type(&element_type, location)?;
ast::LValue::Dereference { reference, element_type }
Expand Down
Loading
Loading