这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@leana8959
Copy link
Contributor

@leana8959 leana8959 commented Aug 8, 2025

Hello,

I noticed multiple mugs in my previous PR, sorry about that.
This PR does multiple checks to make sure no incorrect assists are generated, namely:

  • non recursive attrsets
  • bindings that are used in its own definition
  • pattern binds in lambda arguments
  • inherit clauses with from expressions

Inherit usages are now rewritten with the inherit node removed, and with an extra binding added.

I also fixed a part where I traverse the AST too loosely (.ancestors()) and would overshoot, publishing incorrect assists.

Do let me know if there are cases that I haven't covered! Inlining expressions are way more tricky than I thought it was.

Thank you for your time!

@leana8959 leana8959 force-pushed the feat-fix-no-inline-inherit branch from 5d16c48 to d86634a Compare August 9, 2025 13:03
@leana8959 leana8959 changed the title fix inherit and patfield inline assist fix handling inherit and patfield in inline assist Aug 9, 2025
@leana8959 leana8959 marked this pull request as ready for review August 9, 2025 16:07
@leana8959
Copy link
Contributor Author

I think I have missed a case, I'll fix that when I have time. Sorry about that.

@leana8959
Copy link
Contributor Author

Just fixed that, now no more inline assist is published for plain attrset.

@leana8959 leana8959 marked this pull request as draft August 31, 2025 09:18
This forbids the case of `f: let x = f x; in x' where removing the
binding would make the rewrite semantically incorrect.

assists/inline: make check ast lookup is recursive
@leana8959 leana8959 marked this pull request as ready for review October 11, 2025 03:12
@leana8959 leana8959 changed the title fix handling inherit and patfield in inline assist Fix inline bugs Oct 11, 2025
@leana8959 leana8959 force-pushed the feat-fix-no-inline-inherit branch from 695ae15 to fc55bdd Compare October 11, 2025 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant