已关闭
Fix unexpected CTEs and crashes on function types and lambda expressions with receiver #9819
Fouckttt创建于  4月16日关闭于  6月22日
Fouckttt
Fouckttt
4月16日 创建

Reason

Receiver-based function types and lambda expressions were not handled consistently across checker and lowering. This caused several incorrect behaviors, including unexpected compiler crashes, wrong call-shape diagnostics, and incorrect member
resolution for this inside receiver lambdas. Affected scenarios included local receiver functions, synthetic lambda bodies, interface properties of type (this: T) => R, and cases where a class method and a same-name receiver function were both
visible.

Description

This fix stabilizes receiver-function handling in both checker and lowering:

  • Binds explicit receiver this consistently in checker, including nested arrow/lambda contexts.
  • Re-resolves extension-style calls after desugaring a.foo(...) to foo(a, ...), and avoids self-referential lookup from the current declarator.
  • Lowers synthetic receiver-lambda bodies directly to final invoke* form instead of relying on reset/re-check of generated bodies.
  • Uses a dedicated ordinary parameter for receiver-lambda bridge methods so lambda-object this and receiver this are no longer conflated.
  • Treats interface-property-backed callables as field-like during call resolution, so expressions such as i.f(a) are checked as ordinary function-value calls instead of extension-method calls.
  • Preserves real instance member priority for this.f() / a.f() over same-name receiver-function candidates when a class member already exists.

Relevant local results:

es2abc Test Cases (Debug Mode)
Passed

Verifier Testing
Passed

64-bit RK Compilation
Passed

Compile macOS SDK
Passed

likedislike
openharmony_ci
openharmony_ci成员
4月16日 评论:

感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@xucheng46](https://gitcode.com/xucheng46) [@gavin1012_hw](https://gitcode.com/gavin1012_hw) [@trubachevilya](https://gitcode.com/trubachevilya) [@vpukhov](https://gitcode.com/vpukhov) [@chernykhsergey](https://gitcode.com/chernykhsergey) [@zhuoli](https://gitcode.com/zhuoli) 。如果需要调整订阅PR、Issue的变更状态,请访问链接。


Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
openharmony_ciopenharmony_ci成员
4月16日 添加了label:waiting_for_assign
FoucktttFouckttt
4月16日 修改了issue 的描述
FoucktttFouckttt
4月16日 修改了issue 的描述
FoucktttFouckttt
4月16日 关联了pull request:Fix function types and lambda expressions with receiver
FoucktttFouckttt
4月16日 关联了pull request:Fix function types and lambda expressions with receiver
FoucktttFouckttt
4月16日 关联了pull request:Fix function types and lambda expressions with receiver
FoucktttFouckttt
4月19日 关联了pull request:Fix function types and lambda exp with receiver
FoucktttFouckttt
6月22日 issue状态由 待办的 改变为 已完成
FoucktttFouckttt
6月22日 关闭了 issue