Constants defined under a payload alias (YAML = Psych) are emitted under the alias name, rejected by sorbet >= 0.6.13550
Los mantenedores suelen responder en 4 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 57/100
Línea de trabajo
Start by reading Tapioca’s gem RBI generation path and how it resolves constant namespaces; the issue identifies the generated nested constant as the failing case. Reproduce with bundle exec tapioca gem yaml and bundle exec srb tc using the stated versions. Done means the generated RBI handles YAML::LOADER_VERSION without Sorbet error 4022 while the constant remains accessible as a String through YAML.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Since sorbet 0.6.13550 (sorbet/sorbet#10758; related: sorbet/sorbet#10767 for the net-http counterpart), Sorbet rejects any definition nested under a payload constant alias. The yaml gem RBI that tapioca generates now fails srb tc:
sorbet/rbi/gems/[email protected]:9: Redefining constant `YAML` as a class or module https://srb.help/4022
https://github.com/sorbet/sorbet/tree/b3a38a5fcb5cfeadd9031b3ddf513547f2c2f229/rbi/stdlib/yaml.rbi#L62: Previously defined as a static field here
62 |YAML = Psych # :nodoc:
Reproduction
- tapioca 0.20.0, sorbet 0.6.13550, Ruby 4.0.6,
yaml0.4.0 (a dependency ofpagy) bundle exec tapioca gem yamlgenerates:
# pkg:gem/yaml#lib/yaml.rb:69
YAML::LOADER_VERSION = T.let(T.unsafe(nil), String)
bundle exec srb tcreports the 4022 error above. Minimal case without tapioca: sorbet.run. sorbet 0.6.13544 accepts it.
The gem's lib/yaml.rb does YAML = Psych and later module YAML; LOADER_VERSION = "0.4.0"; end. At runtime YAML.equal?(Psych) is true, so the constant really lives on Psych.
Expected
When the namespace is an alias, tapioca should emit the constant under the alias target's real name (Psych::LOADER_VERSION = T.let(T.unsafe(nil), String)). Sorbet 0.6.13550 accepts that, and YAML::LOADER_VERSION still resolves to String. Alternatively, it could skip constants whose namespace is a payload alias.
Tapioca 0.20.0 already drops the module YAML; end line that older versions emitted. The same reasoning has to cover nested constants.
- Lenguaje dominante
- Ruby
- Estrellas
- 874
- Forks
- 166
- Merge medio
- 5 d 12 h
- PR fusionados (30 d)
- 11
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Shopify/tapioca
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Shopify/tapioca#2662 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
Option to omit private methods from gem RBIs, with a per-gem opt-inPosiblemente ocupada @efegokdemir la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
Los mantenedores suelen responder en 4 días
-
Improve `check-shims` performancePosiblemente ocupada @KaanOzkan la tomó hace 15 días. Abierto
Shopify/tapioca#2728 · 1 asignado ·
Los mantenedores suelen responder en 4 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
Los mantenedores suelen responder en 4 días
-
Prepending a module can cause `tapioca dsl` to produce an untyped signaturePosiblemente ocupada @KaanOzkan la tomó hace 50 días. Abiertobug
Shopify/tapioca#2705 · 1 asignado ·
Los mantenedores suelen responder en 4 días
Todos los issues de Shopify/tapioca
Issues similares
-
🐞 bug pending triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
CircuitVerse/CircuitVerse#8031 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
riscv/riscv-unified-db#2740 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día