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

steep does not detect uninitialized constant #11

Closed
stereobooster opened this issue Nov 11, 2017 · 2 comments
Closed

steep does not detect uninitialized constant #11

stereobooster opened this issue Nov 11, 2017 · 2 comments

Comments

@stereobooster
Copy link
Contributor

B.new

https://github.com/stereobooster/diamondback-ruby/tree/master/examples#6

@soutaro
Copy link
Owner

soutaro commented Nov 11, 2017

In fact, this is by design.

You have to add an annotation to specify type of constants like # @type const B: String.class. You can use --fallback-any-is-error option to identify if unknown (to steep) constant is referred.

Type of a constant cannot be determined until the execution reaches. It may be re-assigned or declaring a new constant in somewhere else may change the result of constant resolution.

(I know this behavior may be unacceptable because it requires too many boilerplates. I am planning to have some new feature to help to declare types of constants.)

@stereobooster
Copy link
Contributor Author

I see. Do you have opinion on Bidirectional Typechecking? Is it applicable to ruby?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants