Open ulcttku opened 2 years ago
Thank you for your report and sorry for my late action! I've added a tentative fix to suppress the warning.
I'd like to keep this ticket open because there is still room to improve. If an inconsistent type is assigned to a constant that is already defined in RBS, currently it is merged but it should be warned. https://github.com/ruby/typeprof/commit/4804e1e212c37f14893724a876e0f427159afca4#diff-8ac76f2b46ac161391ac2190da7192f7c9b6263037c547efa93ecdfd47a6f660R2
The warning
[warning] already initialized constant Foo::A
is displayed. When a class with constants exists in an RBS file that has already been created.Ruby TypeProf Playground https://mame.github.io/typeprof-playground/#rb=class+Foo%0A++A+%3D+1%0Aend%0A&rbs=class+Foo%0A++A%3A+Integer%0Aend
Ruby
RBS
Output