Skip to content

Instantly share code, notes, and snippets.

@pocke
Created November 1, 2020 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pocke/45e04f2c7316972ac60d67a2440f4498 to your computer and use it in GitHub Desktop.
Save pocke/45e04f2c7316972ac60d67a2440f4498 to your computer and use it in GitHub Desktop.
invalid new type introducing
class C
def self.new: (String) -> untyped
end
class C2 < C
end
module M
def initialize: (String, Integer) -> void
end
# ok
$ rbs -I . method --singleton C new
::C.new
defined_in: ::C
implementation: ::C
accessibility: public
types:
(::String) -> untyped
# It should be (::String) -> untyped, but not
$ rbs -I . method --singleton C2 new
::C2.new
defined_in:
implementation:
accessibility: public
types:
() -> ::C2
# It should be no method, but not.
$ rbs -I . method --singleton M new
::M.new
defined_in:
implementation:
accessibility: public
types:
(::String, ::Integer) -> ::M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment