File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
src/Peachpie.CodeAnalysis/CodeGen/Graph Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -2369,7 +2369,37 @@ partial class BoundCallableConvert
23692369 {
23702370 internal override TypeSymbol Emit ( CodeGenerator cg )
23712371 {
2372- throw new NotImplementedException ( ) ;
2372+ var target = cg . CoreTypes . IPhpCallable ;
2373+
2374+ if ( Receiver != null )
2375+ {
2376+ // Receiver -> Name(...)
2377+ throw new NotImplementedException ( ) ;
2378+ }
2379+ else if ( StaticReceiver != null )
2380+ {
2381+ // StaticReceiver :: Name(...)
2382+ throw new NotImplementedException ( ) ;
2383+ }
2384+ else
2385+ {
2386+ // Name(...)
2387+ if ( this . Name . IsDirect )
2388+ {
2389+ // TODO: PERF: use existing IPhpRoutine singleton
2390+ cg . Builder . EmitStringConstant ( this . Name . NameValue . ToString ( ) ) ;
2391+ }
2392+ else
2393+ {
2394+ cg . EmitConvertToString ( cg . Emit ( this . Name . NameExpression ) , this . Name . NameExpression . TypeRefMask ) ;
2395+ }
2396+
2397+ // -> IPhpCallable
2398+ cg . EmitConvert ( cg . CoreTypes . String , FlowAnalysis . TypeRefMask . AnyType , target ) ;
2399+ }
2400+
2401+ //
2402+ return target ;
23732403 }
23742404 }
23752405
You can’t perform that action at this time.
0 commit comments