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<'_> {
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 ! {
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 {
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 } ;
You can’t perform that action at this time.
0 commit comments