peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.31k stars 201 forks source link

The compiler sees several `Load()` overloads, so it postpones the resolution to runtime using the callsite (`call_Load?0`). #1136

Closed FibonacciFox closed 2 weeks ago

FibonacciFox commented 3 months ago
          The compiler sees several `Load()` overloads, so it postpones the resolution to runtime using the callsite (`call_Load?0`).

The fix would be to improve the compiler so it resolves the Load(object) overload in compile time - I'm not sure, why it's not resolving it already, it should.

Originally posted by @jakubmisek in https://github.com/peachpiecompiler/peachpie/issues/1118#issuecomment-1694814574

Hello, I have a suggestion on how to solve this problem. For example, use named parameters to help the compiler. This way you can tell the compiler which overloaded method to use.

image

Improvement would look like this:

image