Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not handling Arrays or Hashes without type name #43

Closed
connorshea opened this issue Jun 25, 2019 · 3 comments
Closed

Not handling Arrays or Hashes without type name #43

connorshea opened this issue Jun 25, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@connorshea
Copy link
Contributor

Describe the bug
Sord doesn't correctly handle <String> (should be equivalent to Array<String>) or {String => true} (equivalent to Hash{String => true})

I tested sord with zeitwerk and discovered this issue.

To Reproduce

# Absolute paths of files or directories that have to be preloaded.
#
# @private
# @return [<String>]
attr_reader :preloads

Expected behavior

sig { returns(T::Array[String]) }
def preloads(); end

Actual behavior

# sord warn - "<String>" does not appear to be a type
sig { returns(SORD_ERROR_String) }
def preloads(); end

Additional information
The type parser seems to suggest these are valid, so we should try to support them.

@connorshea connorshea added the bug Something isn't working label Jun 25, 2019
@connorshea
Copy link
Contributor Author

connorshea commented Jun 25, 2019

Tested a few gems to see what errors were left to fix:

@AaronC81
Copy link
Owner

That's a really useful insight into where Sord is now! Rouge's issue can be sorted by translating Class<X> into T.class_of(X); I'll create an issue for that.

AaronC81 added a commit that referenced this issue Jun 26, 2019
@AaronC81
Copy link
Owner

This should now be implemented - Zeitwerk no longer has any errors related to this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants