Skip to content

Commit c0dcacd

Browse files
committed
chore: Remove expand test
1 parent fa449e5 commit c0dcacd

File tree

4 files changed

+13
-271
lines changed

4 files changed

+13
-271
lines changed

crates/macros/src/interface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl ToTokens for InterfaceData<'_> {
6060
let _constructor = self
6161
.constructor
6262
.as_ref()
63-
.map(|func| func.constructor_meta(&self.path))
63+
.map(|func| func.constructor_meta(&self.path, Some(&Visibility::Public)))
6464
.option_tokens();
6565

6666
quote! {

crates/macros/tests/expand/interface.expanded.rs

Lines changed: 0 additions & 242 deletions
This file was deleted.

crates/macros/tests/expand/interface.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/builders/class.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,26 @@ impl ClassBuilder {
244244
"Class name in builder does not match class name in `impl RegisteredClass`."
245245
);
246246
self.object_override = Some(create_object::<T>);
247+
let is_interface = T::FLAGS.contains(ClassFlags::Interface);
247248

248249
let (func, visibility) = if let Some(ConstructorMeta {
249250
build_fn, flags, ..
250251
}) = T::constructor()
251252
{
252-
let func = FunctionBuilder::new("__construct", constructor::<T>);
253+
let func = if is_interface {
254+
FunctionBuilder::new_abstract("__construct")
255+
} else {
256+
FunctionBuilder::new("__construct", constructor::<T>)
257+
};
258+
253259
(build_fn(func), flags.unwrap_or(MethodFlags::Public))
254260
} else {
255261
(
256-
FunctionBuilder::new("__construct", constructor::<T>),
262+
if is_interface {
263+
FunctionBuilder::new_abstract("__construct")
264+
} else {
265+
FunctionBuilder::new("__construct", constructor::<T>)
266+
},
257267
MethodFlags::Public,
258268
)
259269
};

0 commit comments

Comments
 (0)