Skip to content

Commit a1e8cea

Browse files
committed
Add manual Default for Scope
1 parent 8ec8ccb commit a1e8cea

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

src/ast.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ impl TreeLike for ExprTree<'_> {
521521
/// 2. Resolving type aliases
522522
/// 3. Assigning types to each witness expression
523523
/// 4. Resolving calls to custom functions
524-
#[derive(Clone, Debug, Eq, PartialEq, Default)]
524+
#[derive(Clone, Debug, Eq, PartialEq)]
525525
struct Scope {
526526
resolutions: ProgramResolutions,
527527
paths: Arc<[SourceName]>,
@@ -536,6 +536,23 @@ struct Scope {
536536
call_tracker: CallTracker,
537537
}
538538

539+
impl Default for Scope {
540+
fn default() -> Self {
541+
Self {
542+
resolutions: Arc::from([]),
543+
paths: Arc::from([]),
544+
file_id: 0,
545+
variables: Vec::new(),
546+
aliases: HashMap::new(),
547+
parameters: HashMap::new(),
548+
witnesses: HashMap::new(),
549+
functions: HashMap::new(),
550+
is_main: false,
551+
call_tracker: CallTracker::default(),
552+
}
553+
}
554+
}
555+
539556
impl Scope {
540557
pub fn new(resolutions: ProgramResolutions, paths: Arc<[SourceName]>) -> Self {
541558
Self {

0 commit comments

Comments
 (0)