tapioca icon indicating copy to clipboard operation
tapioca copied to clipboard

Tapioca DSL Issue: Dynamic method delegation generates `<NOT-TYPED>` return types

Open shristialto opened this issue 2 months ago • 3 comments

Environment:

  • Tapioca v0.13.3
  • Ruby/Rails version:

Issue: When using Core::API with add_api for dynamic method delegation, Tapioca generates <NOT-TYPED> instead of proper return types, causing parse errors.

Reproduction:

  1. Module uses include Core::API and add_api Commands
  2. Commands module has properly typed methods (e.g., ).returns(User))
  3. Running bin/tapioca dsl generates RBI with ).returns(<NOT-TYPED>)
  4. This causes parse errors: "unexpected token '<'"

Expected behavior: Tapioca should analyze the delegated methods and generate proper return types like ).returns(::User).

Workaround: Currently requires manual editing of generated RBI files or excluding modules from DSL generation.

shristialto avatar Oct 17 '25 17:10 shristialto

That's quite an old version of tapioca? Does it happen in recent versions?

KaanOzkan avatar Oct 17 '25 17:10 KaanOzkan

I wasn't having any issues until earlier this morning in this same version, do you think it'll be fixed soon?

shristialto avatar Oct 17 '25 18:10 shristialto

We need more information to investigate. What is Core::API? We need to know which DSL compiler it's triggering and how that DSL compiler is generating <NOT-TYPED> which is a placeholder from sorbet-runtime.

KaanOzkan avatar Oct 17 '25 21:10 KaanOzkan