steep 1.1.1 → 1.2.0.pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/Gemfile +0 -1
  4. data/Gemfile.lock +12 -11
  5. data/Gemfile.steep +1 -1
  6. data/Gemfile.steep.lock +9 -9
  7. data/README.md +3 -3
  8. data/Steepfile +23 -0
  9. data/bin/steep-prof +2 -1
  10. data/lib/steep/annotation_parser.rb +1 -1
  11. data/lib/steep/ast/types/class.rb +4 -0
  12. data/lib/steep/ast/types/factory.rb +86 -602
  13. data/lib/steep/ast/types/instance.rb +4 -0
  14. data/lib/steep/ast/types/literal.rb +1 -1
  15. data/lib/steep/ast/types/proc.rb +22 -8
  16. data/lib/steep/ast/types/self.rb +4 -0
  17. data/lib/steep/ast/types/union.rb +1 -1
  18. data/lib/steep/cli.rb +24 -1
  19. data/lib/steep/diagnostic/ruby.rb +17 -22
  20. data/lib/steep/drivers/checkfile.rb +205 -0
  21. data/lib/steep/drivers/validate.rb +3 -1
  22. data/lib/steep/equatable.rb +2 -0
  23. data/lib/steep/interface/block.rb +21 -11
  24. data/lib/steep/interface/builder.rb +756 -0
  25. data/lib/steep/interface/function.rb +32 -24
  26. data/lib/steep/interface/method_type.rb +191 -78
  27. data/lib/steep/interface/shape.rb +132 -0
  28. data/lib/steep/interface/substitution.rb +23 -12
  29. data/lib/steep/interface/type_param.rb +1 -2
  30. data/lib/steep/path_helper.rb +1 -1
  31. data/lib/steep/project.rb +5 -7
  32. data/lib/steep/server/base_worker.rb +2 -2
  33. data/lib/steep/server/change_buffer.rb +4 -3
  34. data/lib/steep/server/interaction_worker.rb +1 -1
  35. data/lib/steep/server/master.rb +69 -9
  36. data/lib/steep/server/type_check_worker.rb +13 -11
  37. data/lib/steep/server/worker_process.rb +9 -7
  38. data/lib/steep/services/completion_provider.rb +15 -3
  39. data/lib/steep/services/hover_provider/singleton_methods.rb +5 -6
  40. data/lib/steep/services/signature_service.rb +13 -8
  41. data/lib/steep/services/type_check_service.rb +2 -0
  42. data/lib/steep/signature/validator.rb +1 -1
  43. data/lib/steep/subtyping/check.rb +154 -103
  44. data/lib/steep/subtyping/relation.rb +3 -3
  45. data/lib/steep/subtyping/result.rb +20 -2
  46. data/lib/steep/subtyping/variable_variance.rb +9 -0
  47. data/lib/steep/type_construction.rb +558 -299
  48. data/lib/steep/type_inference/block_params.rb +169 -86
  49. data/lib/steep/type_inference/logic_type_interpreter.rb +9 -14
  50. data/lib/steep/type_inference/method_params.rb +12 -7
  51. data/lib/steep/type_inference/send_args.rb +41 -35
  52. data/lib/steep/type_inference/type_env_builder.rb +1 -1
  53. data/lib/steep/version.rb +1 -1
  54. data/lib/steep.rb +71 -2
  55. data/rbs_collection.steep.lock.yaml +18 -30
  56. data/rbs_collection.steep.yaml +1 -0
  57. data/sig/shims/language-server_protocol.rbs +20 -0
  58. data/sig/shims/tagged_logging.rbs +6 -0
  59. data/sig/steep/ast/annotation/collection.rbs +6 -6
  60. data/sig/steep/ast/types/class.rbs +3 -0
  61. data/sig/steep/ast/types/factory.rbs +38 -32
  62. data/sig/steep/ast/types/instance.rbs +3 -0
  63. data/sig/steep/ast/types/intersection.rbs +1 -1
  64. data/sig/steep/ast/types/literal.rbs +7 -7
  65. data/sig/steep/ast/types/name.rbs +14 -13
  66. data/sig/steep/ast/types/proc.rbs +3 -1
  67. data/sig/steep/ast/types/self.rbs +3 -0
  68. data/sig/steep/ast/types/var.rbs +1 -1
  69. data/sig/steep/diagnostic/ruby.rbs +30 -34
  70. data/sig/steep/drivers/annotations.rbs +17 -0
  71. data/sig/steep/drivers/check.rbs +33 -0
  72. data/sig/steep/drivers/checkfile.rbs +26 -0
  73. data/sig/steep/drivers/diagnostic_printer.rbs +25 -0
  74. data/sig/steep/drivers/init.rbs +19 -0
  75. data/sig/steep/drivers/langserver.rbs +35 -0
  76. data/sig/steep/drivers/print_project.rbs +15 -0
  77. data/sig/steep/drivers/stats.rbs +37 -0
  78. data/sig/steep/drivers/utils/driver_helper.rbs +23 -0
  79. data/sig/steep/drivers/utils/jobs_count.rbs +11 -0
  80. data/sig/steep/drivers/validate.rbs +15 -0
  81. data/sig/steep/drivers/vendor.rbs +19 -0
  82. data/sig/steep/drivers/watch.rbs +27 -0
  83. data/sig/steep/drivers/worker.rbs +31 -0
  84. data/sig/steep/equatable.rbs +11 -0
  85. data/sig/steep/index/rbs_index.rbs +91 -0
  86. data/sig/steep/index/signature_symbol_provider.rbs +29 -0
  87. data/sig/steep/index/source_index.rbs +63 -0
  88. data/sig/steep/interface/block.rbs +3 -1
  89. data/sig/steep/interface/builder.rbs +152 -0
  90. data/sig/steep/interface/function.rbs +67 -55
  91. data/sig/steep/interface/method_type.rbs +60 -12
  92. data/sig/steep/interface/shape.rbs +61 -0
  93. data/sig/steep/interface/substitution.rbs +18 -22
  94. data/sig/steep/interface/type_param.rbs +9 -1
  95. data/sig/steep/path_helper.rbs +7 -0
  96. data/sig/steep/project/pattern.rbs +10 -10
  97. data/sig/steep/project/target.rbs +2 -2
  98. data/sig/steep/project.rbs +15 -8
  99. data/sig/steep/server/base_worker.rbs +49 -0
  100. data/sig/steep/server/change_buffer.rbs +32 -0
  101. data/sig/steep/server/interaction_worker.rbs +41 -0
  102. data/sig/steep/server/lsp_formatter.rbs +29 -0
  103. data/sig/steep/server/master.rbs +260 -0
  104. data/sig/steep/server/type_check_worker.rbs +135 -0
  105. data/sig/steep/server/worker_process.rbs +29 -0
  106. data/sig/steep/services/completion_provider.rbs +5 -5
  107. data/sig/steep/services/content_change.rbs +14 -12
  108. data/sig/steep/services/file_loader.rbs +12 -4
  109. data/sig/steep/services/hover_provider/singleton_methods.rbs +1 -1
  110. data/sig/steep/services/path_assignment.rbs +7 -7
  111. data/sig/steep/services/signature_service.rbs +67 -40
  112. data/sig/steep/services/type_check_service.rbs +53 -39
  113. data/sig/steep/subtyping/check.rbs +80 -44
  114. data/sig/steep/subtyping/relation.rbs +24 -22
  115. data/sig/steep/subtyping/result.rbs +48 -30
  116. data/sig/steep/subtyping/variable_variance.rbs +2 -0
  117. data/sig/steep/type_construction.rbs +132 -23
  118. data/sig/steep/type_inference/block_params.rbs +120 -18
  119. data/sig/steep/type_inference/context.rbs +45 -20
  120. data/sig/steep/type_inference/context_array.rbs +37 -0
  121. data/sig/steep/type_inference/logic_type_interpreter.rbs +3 -1
  122. data/sig/steep/type_inference/method_params.rbs +13 -9
  123. data/sig/steep/type_inference/send_args.rbs +229 -0
  124. data/sig/steep/type_inference/type_env_builder.rbs +1 -1
  125. data/sig/steep/typing.rbs +4 -4
  126. data/sig/steep.rbs +4 -2
  127. data/smoke/block/e.rb +12 -0
  128. data/smoke/block/e.rbs +4 -0
  129. data/smoke/block/test_expectations.yml +12 -0
  130. data/smoke/regression/block_param_split.rb +7 -0
  131. data/smoke/regression/block_param_split.rbs +3 -0
  132. data/smoke/regression/empty_yield.rb +5 -0
  133. data/smoke/regression/empty_yield.rbs +3 -0
  134. data/smoke/regression/test_expectations.yml +12 -0
  135. data/smoke/yield/test_expectations.yml +4 -4
  136. data/steep.gemspec +2 -1
  137. metadata +61 -9
  138. data/lib/steep/interface/interface.rb +0 -34
  139. data/sig/steep/interface/interface.rbs +0 -23
  140. data/sig/version.rbs +0 -3
@@ -0,0 +1,17 @@
1
+ module Steep
2
+ module Drivers
3
+ class Annotations
4
+ attr_reader command_line_patterns: untyped
5
+
6
+ attr_reader stdout: untyped
7
+
8
+ attr_reader stderr: untyped
9
+
10
+ include Utils::DriverHelper
11
+
12
+ def initialize: (stdout: untyped, stderr: untyped) -> void
13
+
14
+ def run: () -> 0
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,33 @@
1
+ module Steep
2
+ module Drivers
3
+ class Check
4
+ LSP: untyped
5
+
6
+ attr_reader stdout: untyped
7
+
8
+ attr_reader stderr: untyped
9
+
10
+ attr_reader command_line_patterns: untyped
11
+
12
+ attr_accessor with_expectations_path: untyped
13
+
14
+ attr_accessor save_expectations_path: untyped
15
+
16
+ attr_accessor severity_level: untyped
17
+
18
+ include Utils::DriverHelper
19
+
20
+ include Utils::JobsCount
21
+
22
+ def initialize: (stdout: untyped, stderr: untyped) -> void
23
+
24
+ def run: () -> untyped
25
+
26
+ def print_expectations: (project: untyped, all_files: untyped, expectations_path: untyped, notifications: untyped) -> untyped
27
+
28
+ def save_expectations: (project: untyped, all_files: untyped, expectations_path: untyped, notifications: untyped) -> 0
29
+
30
+ def print_result: (project: untyped, notifications: untyped) -> (0 | 1)
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,26 @@
1
+ module Steep
2
+ module Drivers
3
+ class Checkfile
4
+ LSP: singleton(LanguageServer::Protocol)
5
+
6
+ attr_reader stdout: IO
7
+
8
+ attr_reader stderr: IO
9
+
10
+ attr_reader command_line_args: Array[String]
11
+
12
+ include Utils::DriverHelper
13
+ include Utils::JobsCount
14
+
15
+ attr_accessor all_rbs: bool
16
+
17
+ attr_accessor all_ruby: bool
18
+
19
+ attr_reader stdin_input: Hash[Pathname, String]
20
+
21
+ def initialize: (stdout: IO, stderr: IO) -> void
22
+
23
+ def run: () -> Integer
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,25 @@
1
+ module Steep
2
+ module Drivers
3
+ class DiagnosticPrinter
4
+ LSP: untyped
5
+
6
+ attr_reader stdout: untyped
7
+
8
+ attr_reader buffer: untyped
9
+
10
+ def initialize: (stdout: untyped, buffer: untyped) -> void
11
+
12
+ def path: () -> untyped
13
+
14
+ def color_severity: (untyped string, severity: untyped) -> untyped
15
+
16
+ def severity_message: (untyped severity) -> untyped
17
+
18
+ def location: (untyped diagnostic) -> untyped
19
+
20
+ def print: (untyped diagnostic, ?prefix: ::String, ?source: bool) -> untyped
21
+
22
+ def print_source_line: (untyped diagnostic, ?prefix: ::String) -> untyped
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,19 @@
1
+ module Steep
2
+ module Drivers
3
+ class Init
4
+ attr_reader stdout: untyped
5
+
6
+ attr_reader stderr: untyped
7
+
8
+ attr_accessor force_write: untyped
9
+
10
+ include Utils::DriverHelper
11
+
12
+ TEMPLATE: "# D = Steep::Diagnostic\n#\n# target :lib do\n# signature \"sig\"\n#\n# check \"lib\" # Directory name\n# check \"Gemfile\" # File name\n# check \"app/models/**/*.rb\" # Glob\n# # ignore \"lib/templates/*.rb\"\n#\n# # library \"pathname\", \"set\" # Standard libraries\n# # library \"strong_json\" # Gems\n# \n# # configure_code_diagnostics(D::Ruby.strict) # `strict` diagnostics setting\n# # configure_code_diagnostics(D::Ruby.lenient) # `lenient` diagnostics setting\n# # configure_code_diagnostics do |hash| # You can setup everything yourself\n# # hash[D::Ruby::NoMethod] = :information\n# # end\n# end\n\n# target :test do\n# signature \"sig\", \"sig-private\"\n#\n# check \"test\"\n#\n# # library \"pathname\", \"set\" # Standard libraries\n# end\n"
13
+
14
+ def initialize: (stdout: untyped, stderr: untyped) -> void
15
+
16
+ def run: () -> (1 | 0)
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,35 @@
1
+ module Steep
2
+ module Drivers
3
+ class Langserver
4
+ attr_reader stdout: untyped
5
+
6
+ attr_reader stderr: untyped
7
+
8
+ attr_reader stdin: untyped
9
+
10
+ attr_reader latest_update_version: untyped
11
+
12
+ attr_reader write_mutex: untyped
13
+
14
+ attr_reader type_check_queue: untyped
15
+
16
+ attr_reader type_check_thread: untyped
17
+
18
+ include Utils::DriverHelper
19
+
20
+ include Utils::JobsCount
21
+
22
+ TypeCheckRequest: untyped
23
+
24
+ def initialize: (stdout: untyped, stderr: untyped, stdin: untyped) -> void
25
+
26
+ def writer: () -> untyped
27
+
28
+ def reader: () -> untyped
29
+
30
+ def project: () -> untyped
31
+
32
+ def run: () -> 0
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,15 @@
1
+ module Steep
2
+ module Drivers
3
+ class PrintProject
4
+ attr_reader stdout: untyped
5
+
6
+ attr_reader stderr: untyped
7
+
8
+ include Utils::DriverHelper
9
+
10
+ def initialize: (stdout: untyped, stderr: untyped) -> void
11
+
12
+ def run: () -> 0
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,37 @@
1
+ module Steep
2
+ module Drivers
3
+ class Stats
4
+ class CSVPrinter
5
+ attr_reader io: untyped
6
+
7
+ def initialize: (io: untyped) -> void
8
+
9
+ def print: (untyped stats_result) -> untyped
10
+ end
11
+
12
+ class TablePrinter
13
+ attr_reader io: untyped
14
+
15
+ def initialize: (io: untyped) -> void
16
+
17
+ def print: (untyped stats_result) -> untyped
18
+ end
19
+
20
+ attr_reader stdout: untyped
21
+
22
+ attr_reader stderr: untyped
23
+
24
+ attr_reader command_line_patterns: untyped
25
+
26
+ attr_accessor format: untyped
27
+
28
+ include Utils::DriverHelper
29
+
30
+ include Utils::JobsCount
31
+
32
+ def initialize: (stdout: untyped, stderr: untyped) -> void
33
+
34
+ def run: () -> 0
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,23 @@
1
+ module Steep
2
+ module Drivers
3
+ module Utils
4
+ module DriverHelper
5
+ attr_accessor steepfile: Pathname?
6
+
7
+ def load_config: (?path: Pathname) -> Project
8
+
9
+ def type_check: (Project project) -> void
10
+
11
+ def request_id: () -> String
12
+
13
+ def wait_for_response_id: (reader: untyped, id: untyped, ?unknown_responses: ::Symbol) -> untyped
14
+
15
+ def shutdown_exit: (writer: untyped, reader: untyped) -> untyped
16
+
17
+ def wait_for_message: (reader: untyped, ?unknown_messages: ::Symbol) { (untyped) -> untyped } -> untyped
18
+
19
+ def keep_diagnostic?: (untyped diagnostic) -> bool
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,11 @@
1
+ module Steep
2
+ module Drivers
3
+ module Utils
4
+ module JobsCount
5
+ attr_accessor jobs_count: Integer
6
+
7
+ attr_accessor steep_command: String
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ module Steep
2
+ module Drivers
3
+ class Validate
4
+ attr_reader stdout: untyped
5
+
6
+ attr_reader stderr: untyped
7
+
8
+ include Utils::DriverHelper
9
+
10
+ def initialize: (stdout: untyped, stderr: untyped) -> void
11
+
12
+ def run: () -> untyped
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,19 @@
1
+ module Steep
2
+ module Drivers
3
+ class Vendor
4
+ attr_reader stdout: untyped
5
+
6
+ attr_reader stderr: untyped
7
+
8
+ attr_reader stdin: untyped
9
+
10
+ attr_accessor vendor_dir: untyped
11
+
12
+ attr_accessor clean_before: untyped
13
+
14
+ def initialize: (stdout: untyped, stderr: untyped, stdin: untyped) -> void
15
+
16
+ def run: () -> 0
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,27 @@
1
+ module Steep
2
+ module Drivers
3
+ class Watch
4
+ attr_reader dirs: untyped
5
+
6
+ attr_reader stdout: untyped
7
+
8
+ attr_reader stderr: untyped
9
+
10
+ attr_reader queue: untyped
11
+
12
+ attr_accessor severity_level: untyped
13
+
14
+ include Utils::DriverHelper
15
+
16
+ include Utils::JobsCount
17
+
18
+ LSP: untyped
19
+
20
+ def initialize: (stdout: untyped, stderr: untyped) -> void
21
+
22
+ def watching?: (untyped changed_path, files: untyped, dirs: untyped) -> untyped
23
+
24
+ def run: () -> (1 | 0)
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,31 @@
1
+ module Steep
2
+ module Drivers
3
+ class Worker
4
+ attr_reader stdout: untyped
5
+
6
+ attr_reader stderr: untyped
7
+
8
+ attr_reader stdin: untyped
9
+
10
+ attr_accessor steepfile_path: untyped
11
+
12
+ attr_accessor worker_type: untyped
13
+
14
+ attr_accessor worker_name: untyped
15
+
16
+ attr_accessor delay_shutdown: untyped
17
+
18
+ attr_accessor max_index: untyped
19
+
20
+ attr_accessor index: untyped
21
+
22
+ attr_accessor commandline_args: untyped
23
+
24
+ include Utils::DriverHelper
25
+
26
+ def initialize: (stdout: untyped, stderr: untyped, stdin: untyped) -> void
27
+
28
+ def run: () -> 0
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,11 @@
1
+ module Steep
2
+ # Defines equality and `#hash` based on instance variables
3
+ #
4
+ module Equatable
5
+ def ==: (untyped other) -> bool
6
+
7
+ def eql?: (untyped other) -> bool
8
+
9
+ def hash: () -> Integer
10
+ end
11
+ end
@@ -0,0 +1,91 @@
1
+ module Steep
2
+ module Index
3
+ class RBSIndex
4
+ class TypeEntry
5
+ attr_reader type_name: untyped
6
+
7
+ attr_reader declarations: untyped
8
+
9
+ attr_reader references: untyped
10
+
11
+ def initialize: (type_name: untyped) -> void
12
+
13
+ def add_declaration: (untyped decl) -> untyped
14
+
15
+ def add_reference: (untyped ref) -> untyped
16
+ end
17
+
18
+ class MethodEntry
19
+ attr_reader method_name: untyped
20
+
21
+ attr_reader declarations: untyped
22
+
23
+ attr_reader references: untyped
24
+
25
+ def initialize: (method_name: untyped) -> void
26
+
27
+ def add_declaration: (untyped decl) -> untyped
28
+ end
29
+
30
+ class ConstantEntry
31
+ attr_reader const_name: untyped
32
+
33
+ attr_reader declarations: untyped
34
+
35
+ def initialize: (const_name: untyped) -> void
36
+
37
+ def add_declaration: (untyped decl) -> untyped
38
+ end
39
+
40
+ class GlobalEntry
41
+ attr_reader global_name: untyped
42
+
43
+ attr_reader declarations: untyped
44
+
45
+ def initialize: (global_name: untyped) -> void
46
+
47
+ def add_declaration: (untyped decl) -> untyped
48
+ end
49
+
50
+ attr_reader type_index: untyped
51
+
52
+ attr_reader method_index: untyped
53
+
54
+ attr_reader const_index: untyped
55
+
56
+ attr_reader global_index: untyped
57
+
58
+ def initialize: () -> void
59
+
60
+ def entry: (?type_name: untyped?, ?method_name: untyped?, ?const_name: untyped?, ?global_name: untyped?) -> untyped
61
+
62
+ def each_entry: () { () -> untyped } -> untyped
63
+
64
+ def add_type_declaration: (untyped type_name, untyped declaration) -> untyped
65
+
66
+ def add_method_declaration: (untyped method_name, untyped member) -> untyped
67
+
68
+ def add_constant_declaration: (untyped const_name, untyped decl) -> untyped
69
+
70
+ def add_global_declaration: (untyped global_name, untyped decl) -> untyped
71
+
72
+ def each_declaration: (?type_name: untyped?, ?method_name: untyped?, ?const_name: untyped?, ?global_name: untyped?) { () -> untyped } -> untyped
73
+
74
+ def add_type_reference: (untyped type_name, untyped ref) -> untyped
75
+
76
+ def each_reference: (?type_name: untyped?) { () -> untyped } -> untyped
77
+
78
+ class Builder
79
+ attr_reader index: untyped
80
+
81
+ def initialize: (index: untyped) -> void
82
+
83
+ def member: (untyped type_name, untyped member) -> untyped
84
+
85
+ def type_reference: (untyped `type`, from: untyped) -> untyped
86
+
87
+ def env: (untyped env) -> untyped
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,29 @@
1
+ module Steep
2
+ module Index
3
+ class SignatureSymbolProvider
4
+ LSP: untyped
5
+
6
+ SymbolInformation: untyped
7
+
8
+ attr_reader project: untyped
9
+
10
+ attr_reader indexes: untyped
11
+
12
+ attr_reader assignment: untyped
13
+
14
+ def initialize: (project: untyped, assignment: untyped) -> void
15
+
16
+ def self.test_type_name: (untyped query, untyped type_name) -> untyped
17
+
18
+ alias self.test_const_name self.test_type_name
19
+
20
+ alias self.test_global_name self.test_type_name
21
+
22
+ def self.test_method_name: (untyped query, untyped method_name) -> untyped
23
+
24
+ def assigned?: (untyped path) -> untyped
25
+
26
+ def query_symbol: (untyped query) -> untyped
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,63 @@
1
+ module Steep
2
+ module Index
3
+ class SourceIndex
4
+ class ConstantEntry
5
+ attr_reader name: untyped
6
+
7
+ attr_reader definitions: untyped
8
+
9
+ attr_reader references: untyped
10
+
11
+ def initialize: (name: untyped) -> void
12
+
13
+ def add_definition: (untyped node) -> untyped
14
+
15
+ def add_reference: (untyped node) -> untyped
16
+
17
+ def merge!: (untyped other) -> untyped
18
+ end
19
+
20
+ class MethodEntry
21
+ attr_reader name: untyped
22
+
23
+ attr_reader definitions: untyped
24
+
25
+ attr_reader references: untyped
26
+
27
+ def initialize: (name: untyped) -> void
28
+
29
+ def add_definition: (untyped node) -> untyped
30
+
31
+ def add_reference: (untyped node) -> untyped
32
+
33
+ def merge!: (untyped other) -> untyped
34
+ end
35
+
36
+ attr_reader source: untyped
37
+
38
+ attr_reader constant_index: untyped
39
+
40
+ attr_reader method_index: untyped
41
+
42
+ attr_reader parent: untyped
43
+
44
+ attr_reader count: untyped
45
+
46
+ attr_reader parent_count: untyped
47
+
48
+ def initialize: (source: untyped, ?parent: untyped?) -> void
49
+
50
+ def new_child: () -> untyped
51
+
52
+ def merge!: (untyped child) -> untyped
53
+
54
+ def add_definition: (definition: untyped, ?constant: untyped?, ?method: untyped?) -> untyped
55
+
56
+ def add_reference: (ref: untyped, ?constant: untyped?, ?method: untyped?) -> untyped
57
+
58
+ def entry: (?constant: untyped?, ?method: untyped?) -> untyped
59
+
60
+ def reference: (?constant_node: untyped?) -> untyped
61
+ end
62
+ end
63
+ end
@@ -3,9 +3,11 @@ module Steep
3
3
  class Block
4
4
  attr_reader type: Function
5
5
 
6
+ attr_reader self_type: AST::Types::t?
7
+
6
8
  attr_reader optional: bool
7
9
 
8
- def initialize: (type: Function, optional: bool) -> void
10
+ def initialize: (type: Function, self_type: AST::Types::t?, optional: bool) -> void
9
11
 
10
12
  def optional?: () -> bool
11
13