Raise when type parameters collide during sig to RBS translation - #1017
Hashim1999164 wants to merge 3 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 |
Summary
Closes #1012
Test plan