Repository navigation
Raise when type parameters collide during sig to RBS translation - #1017
Hashim1999164 wants to merge 6 commits into
Conversation
|
My concern with this is renaming a user's type name can lead to confusion if that name is surfaced later. I'm thinking a better strategy will be to raise an error suggesting the user rename to avoid the collision. That keeps the user in control and the names consistent. |
|
@jesse-shopify hi, i understand your concern. Can you please take it up from here. I wint be available upcoming few days. Thanks |
|
@jesse-shopify I switched this to raise instead of renaming. The error asks the user to rename the type parameter so the original names stay consistent and they stay in control. |
|
@jesse-shopify yeah that makes sense. dropped the rename approach. it raises now and tells you to rename the type param yourself so names stay consistent. |
0638b0a to
4482ddd
Compare
Assign proc_returns and proc_bind to locals before visit_type so Sorbet can narrow T.nilable(RBI::Type) down to RBI::Type.
|
@jesse-shopify CI was red on a Sorbet nilable thing for proc_returns / proc_bind. pushed a tiny fix that assigns them to locals before visit_type so the type narrows. should be green now |
…shadowing # Conflicts: # lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb
|
@jesse-shopify yeah this PR already raises instead of renaming, just had to rebase through a conflict on main. should be good now. |
|
@jesse-shopify any update on this one? it's approved and rebased, just checking if anything else is needed before merge |
|
@jesse-shopify any update on this? still approved on my side, just checking if its waiting on anything else to merge |
|
This is still failing CI. I hope to look at it later today. |
|
@jesse-shopify fixed the CI typecheck fail. ClassOf uses singular |
RBI::Type::ClassOf exposes type_parameter, not type_parameters.
511717f to
ab679b4
Compare
|
@jesse-shopify one more thing: the Ruby workflow on the latest commit is waiting on maintainer approval for fork PRs ( |
Summary
Closes #1012
Test plan