obj.respond_to? :method_name isn't working correctly
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 40/100
Línea de trabajo
Comienza reproduciendo el comportamiento con shopify_api versión 13.4 usando el product API object y los pasos de respond_to? indicados en el issue. Rastrea cómo respond_to? produce true, false o T::Private::Types::Void::VOID; se considera terminado cuando devuelve true o false de forma consistente y una llamada no compatible genera NoMethodError.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Issue summary
When using api_object.respond_to?(:method_name) the lib sometimes returns true and sometimes returns T::Private::Types::Void::VOID Sorbet private void type. It seems that true was returned if the method name had been previously used to dereference the object but on more inspection I am not so sure that's the case.
shopify_apiversion: 13.4- Ruby version:
- Operating system:
Expected behavior
When calling respond_to? with a method name the object should return true if the object is able to respond to the method call or false if it is not, and if you call the method name on the object after it returns false it should raise a NoMethodError
Actual behavior
Sometimes the response is true, sometimes it's a private Sorbet type T::Private::Types::Void::VOID, and sometimes it switches from the private type to true after you dereference the object with the method in question.
Steps to reproduce the problem
- Instantiate an api object (I used a product)
- Invoke
respond_to?on it (api_object.respond_to? :some_bs_method) - Bonus points - try invoking the method on the object after receiving the Sorbet type as a response and then calling
respond_to?with the method name, it was returning true for me after doing so
- Lenguaje dominante
- Ruby
- Estrellas
- 1.1k
- Forks
- 484
- Merge medio
- 4 h 38 min
- PR fusionados (30 d)
- 1
Preparar el entorno
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/shopify-api-ruby
-
devtools-gardener
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Shopify/shopify-api-ruby#1456 · 3 reacciones ·
-
devtools-gardener
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
Shopify/shopify-api-ruby#1461 · 1 comentario ·
-
automated
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Shopify/shopify-api-ruby#1460 ·
-
devtools-gardener
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Shopify/shopify-api-ruby#1455 ·
-
devtools-gardener
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Shopify/shopify-api-ruby#1453 · 1 comentario ·
Todos los issues de Shopify/shopify-api-ruby
Issues similares
-
security
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
solana-foundation/pay-kit#341 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
julienXX/terminal-notifier#333 ·
-
Plash is no longer open sourceAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
serhii-londar/open-source-mac-os-apps#1419 ·
Los mantenedores suelen responder en 5 días