rbs
rbs copied to clipboard
URI is missing
I am trying to state that an accessor (called :uri) is of type URI but it fails. Does this exist and I am doing something wrong, or is it missing?
sig/lib/hearth/request.rbs:5:23: [error] Cannot find type `URI`
│ Diagnostic ID: RBS::UnknownTypeName
│
└ attr_accessor uri: URI
URI type signatures exist here. https://github.com/ruby/rbs/tree/master/stdlib/uri/0
stdlib require loaded in some way.
The recommended way is rbs collection
.
https://github.com/ruby/rbs/blob/master/docs/collection.md
Thanks for the quick response. Shouldn't URI be included by default since it's in stdlib? I'm a bit confused why it would be considered third party. I will have to look to see how to integrate this with GH actions..
We need to require 'uri'
to use URI
.
However, I think it is a constant that does not exist in an environment that does not require 'uri'
and would be included in the mistakes we want to detect.