We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c663795 commit c04caecCopy full SHA for c04caec
1 file changed
scenario/rbs/param8.rb
@@ -1,4 +1,33 @@
1
## update: test.rbs
2
class Foo[X]
3
+ def initialize: (X) -> void
4
@x: X
5
+ # TODO: Currently, handling a type variable is immature.
6
+ # Unless the explicit declaration of get_x, a bare type variable X is leaked.
7
+ # A naive fix will bring huge performance penalties, so we need a good solution.
8
+ def get_x: -> X
9
+end
10
+
11
+## update: test.rb
12
+class Foo
13
+ def initialize(x)
14
+ @x = x
15
+ end
16
17
+ def get_x
18
+ @x
19
20
21
22
+def check
23
+ Foo.new(1).get_x
24
25
26
+## assert
27
28
+ def initialize: (var[X]) -> (Object | var[X])
29
+ def get_x: -> var[X]
30
31
+class Object
32
+ def check: -> Integer
33
end
0 commit comments