File tree Expand file tree Collapse file tree 4 files changed +13
-271
lines changed Expand file tree Collapse file tree 4 files changed +13
-271
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ impl ToTokens for InterfaceData<'_> {
60
60
let _constructor = self
61
61
. constructor
62
62
. as_ref ( )
63
- . map ( |func| func. constructor_meta ( & self . path ) )
63
+ . map ( |func| func. constructor_meta ( & self . path , Some ( & Visibility :: Public ) ) )
64
64
. option_tokens ( ) ;
65
65
66
66
quote ! {
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -244,16 +244,26 @@ impl ClassBuilder {
244
244
"Class name in builder does not match class name in `impl RegisteredClass`."
245
245
) ;
246
246
self . object_override = Some ( create_object :: < T > ) ;
247
+ let is_interface = T :: FLAGS . contains ( ClassFlags :: Interface ) ;
247
248
248
249
let ( func, visibility) = if let Some ( ConstructorMeta {
249
250
build_fn, flags, ..
250
251
} ) = T :: constructor ( )
251
252
{
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
+
253
259
( build_fn ( func) , flags. unwrap_or ( MethodFlags :: Public ) )
254
260
} else {
255
261
(
256
- FunctionBuilder :: new ( "__construct" , constructor :: < T > ) ,
262
+ if is_interface {
263
+ FunctionBuilder :: new_abstract ( "__construct" )
264
+ } else {
265
+ FunctionBuilder :: new ( "__construct" , constructor :: < T > )
266
+ } ,
257
267
MethodFlags :: Public ,
258
268
)
259
269
} ;
You can’t perform that action at this time.
0 commit comments