IdentityCache compiler generates wrong return types for fetch_multi_n_by_m
fields
#1770
Labels
bug
Something isn't working
fetch_multi_n_by_m
fields
#1770
Description
After implementing the missing
fetch_multi_n_by_m
methods in #1758 I have found out that the method signature isn't always correct as shown in this example fromcache_attribute
: https://github.com/Shopify/identity_cache/blob/main/lib/identity_cache/cached/attribute.rb#L82-L101The result of methods that include
by
in the name is a hash where:m
(be it a single value or an array of multiple)n
orT::Array[n]
depending on things like ifunique
has been passed tocache_attribute
.So at present when the return type is
T::Array[n]
, it would be expected that it is actuallyT::Hash[T.untyped, n]
orT::Hash[T.untyped, T::Array[n]]
based on how it was created.The text was updated successfully, but these errors were encountered: