Skip to content

Commit ecd20bd

Browse files
authored
fix(stackable-versioned): Emit an error when invalid items are added to the versioned module (#1059)
1 parent 61c8a4f commit ecd20bd

File tree

1 file changed

+8
-1
lines changed
  • crates/stackable-versioned-macros/src/codegen

1 file changed

+8
-1
lines changed

crates/stackable-versioned-macros/src/codegen/module.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,14 @@ impl Module {
108108
),
109109
}
110110
}
111-
_ => continue,
111+
// NOTE (@NickLarsenNZ): We throw an error here so the developer isn't surprised when items they have
112+
// defined in the module are no longer accessible (because they are not re-emitted).
113+
disallowed_item => errors.push(
114+
Error::custom(
115+
"Item not allowed here. Please move it ouside of the versioned module",
116+
)
117+
.with_span(&disallowed_item),
118+
),
112119
};
113120
}
114121

0 commit comments

Comments
 (0)