typeprof 0.15.2 → 0.20.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +1 -1
- data/Gemfile.lock +4 -4
- data/doc/ide.md +81 -0
- data/doc/typeprof-for-ide-log.png +0 -0
- data/doc/typeprof-for-ide.png +0 -0
- data/exe/typeprof +5 -1
- data/lib/typeprof/analyzer.rb +235 -56
- data/lib/typeprof/arguments.rb +1 -0
- data/lib/typeprof/builtin.rb +23 -23
- data/lib/typeprof/cli.rb +23 -5
- data/lib/typeprof/code-range.rb +177 -0
- data/lib/typeprof/config.rb +41 -20
- data/lib/typeprof/container-type.rb +10 -1
- data/lib/typeprof/export.rb +191 -15
- data/lib/typeprof/import.rb +38 -9
- data/lib/typeprof/insns-def.rb +1 -0
- data/lib/typeprof/iseq.rb +224 -17
- data/lib/typeprof/lsp.rb +884 -0
- data/lib/typeprof/method.rb +15 -11
- data/lib/typeprof/type.rb +46 -38
- data/lib/typeprof/utils.rb +18 -1
- data/lib/typeprof/version.rb +1 -1
- data/lib/typeprof.rb +3 -5
- data/typeprof-lsp +3 -0
- data/typeprof.gemspec +2 -2
- data/vscode/.gitignore +5 -0
- data/vscode/.vscode/launch.json +16 -0
- data/vscode/.vscodeignore +7 -0
- data/vscode/README.md +22 -0
- data/vscode/development.md +31 -0
- data/vscode/package-lock.json +2211 -0
- data/vscode/package.json +71 -0
- data/vscode/sandbox/test.rb +24 -0
- data/vscode/src/extension.ts +285 -0
- data/vscode/tsconfig.json +15 -0
- metadata +20 -333
- data/smoke/alias.rb +0 -31
- data/smoke/alias2.rb +0 -21
- data/smoke/any-cbase.rb +0 -5
- data/smoke/any1.rb +0 -16
- data/smoke/any2.rb +0 -18
- data/smoke/arguments.rb +0 -17
- data/smoke/arguments2.rb +0 -56
- data/smoke/array-each.rb +0 -15
- data/smoke/array-each2.rb +0 -16
- data/smoke/array-each3.rb +0 -13
- data/smoke/array-ltlt.rb +0 -14
- data/smoke/array-ltlt2.rb +0 -17
- data/smoke/array-map.rb +0 -12
- data/smoke/array-map2.rb +0 -11
- data/smoke/array-map3.rb +0 -23
- data/smoke/array-mul.rb +0 -18
- data/smoke/array-plus1.rb +0 -11
- data/smoke/array-plus2.rb +0 -16
- data/smoke/array-pop.rb +0 -12
- data/smoke/array-range-aref.rb +0 -71
- data/smoke/array-replace.rb +0 -13
- data/smoke/array-s-aref.rb +0 -12
- data/smoke/array1.rb +0 -27
- data/smoke/array10.rb +0 -15
- data/smoke/array11.rb +0 -14
- data/smoke/array12.rb +0 -25
- data/smoke/array13.rb +0 -31
- data/smoke/array14.rb +0 -14
- data/smoke/array15.rb +0 -16
- data/smoke/array2.rb +0 -28
- data/smoke/array3.rb +0 -26
- data/smoke/array4.rb +0 -15
- data/smoke/array5.rb +0 -14
- data/smoke/array6.rb +0 -17
- data/smoke/array7.rb +0 -14
- data/smoke/array8.rb +0 -13
- data/smoke/array9.rb +0 -13
- data/smoke/attr-module.rb +0 -24
- data/smoke/attr-vis.rb +0 -43
- data/smoke/attr-vis.rbs +0 -4
- data/smoke/attr.rb +0 -28
- data/smoke/autoload.rb +0 -14
- data/smoke/backtrace.rb +0 -33
- data/smoke/block-ambiguous.rb +0 -37
- data/smoke/block-args1-rest.rb +0 -64
- data/smoke/block-args1.rb +0 -60
- data/smoke/block-args2-rest.rb +0 -64
- data/smoke/block-args2.rb +0 -60
- data/smoke/block-args3-rest.rb +0 -75
- data/smoke/block-args3.rb +0 -71
- data/smoke/block-blockarg.rb +0 -28
- data/smoke/block-kwarg.rb +0 -53
- data/smoke/block1.rb +0 -23
- data/smoke/block10.rb +0 -15
- data/smoke/block11.rb +0 -40
- data/smoke/block12.rb +0 -23
- data/smoke/block13.rb +0 -9
- data/smoke/block13.rbs +0 -3
- data/smoke/block14.rb +0 -18
- data/smoke/block2.rb +0 -15
- data/smoke/block3.rb +0 -38
- data/smoke/block4.rb +0 -19
- data/smoke/block5.rb +0 -21
- data/smoke/block6.rb +0 -21
- data/smoke/block7.rb +0 -19
- data/smoke/block8.rb +0 -28
- data/smoke/block9.rb +0 -13
- data/smoke/block_given.rb +0 -37
- data/smoke/blown.rb +0 -13
- data/smoke/break1.rb +0 -19
- data/smoke/break2.rb +0 -16
- data/smoke/break3.rb +0 -13
- data/smoke/break4.rb +0 -17
- data/smoke/case.rb +0 -17
- data/smoke/case2.rb +0 -18
- data/smoke/case3.rb +0 -17
- data/smoke/class-hierarchy.rb +0 -54
- data/smoke/class-hierarchy2.rb +0 -27
- data/smoke/class-new.rb +0 -15
- data/smoke/class.rb +0 -7
- data/smoke/class_eval.rb +0 -22
- data/smoke/class_instance_var.rb +0 -9
- data/smoke/class_method.rb +0 -25
- data/smoke/class_method2.rb +0 -21
- data/smoke/class_method3.rb +0 -29
- data/smoke/constant1.rb +0 -46
- data/smoke/constant2.rb +0 -36
- data/smoke/constant3.rb +0 -10
- data/smoke/constant4.rb +0 -12
- data/smoke/context-sensitive1.rb +0 -13
- data/smoke/cvar.rb +0 -31
- data/smoke/cvar2.rb +0 -17
- data/smoke/define_method.rb +0 -16
- data/smoke/define_method2.rb +0 -18
- data/smoke/define_method3.rb +0 -14
- data/smoke/define_method3.rbs +0 -3
- data/smoke/define_method4.rb +0 -15
- data/smoke/define_method4.rbs +0 -3
- data/smoke/define_method5.rb +0 -12
- data/smoke/define_method6.rb +0 -19
- data/smoke/define_method7.rb +0 -18
- data/smoke/demo.rb +0 -81
- data/smoke/demo1.rb +0 -17
- data/smoke/demo10.rb +0 -21
- data/smoke/demo11.rb +0 -12
- data/smoke/demo2.rb +0 -15
- data/smoke/demo3.rb +0 -17
- data/smoke/demo4.rb +0 -27
- data/smoke/demo5.rb +0 -16
- data/smoke/demo6.rb +0 -22
- data/smoke/demo7.rb +0 -15
- data/smoke/demo8.rb +0 -19
- data/smoke/demo9.rb +0 -18
- data/smoke/dummy-execution1.rb +0 -15
- data/smoke/dummy-execution2.rb +0 -16
- data/smoke/dummy_element.rb +0 -14
- data/smoke/ensure1.rb +0 -21
- data/smoke/enum_for.rb +0 -15
- data/smoke/enum_for2.rb +0 -17
- data/smoke/enumerator.rb +0 -16
- data/smoke/expandarray1.rb +0 -23
- data/smoke/expandarray2.rb +0 -24
- data/smoke/extended.rb +0 -38
- data/smoke/fib.rb +0 -28
- data/smoke/flip-flop.rb +0 -28
- data/smoke/flow1.rb +0 -17
- data/smoke/flow10.rb +0 -17
- data/smoke/flow11.rb +0 -17
- data/smoke/flow2.rb +0 -15
- data/smoke/flow3.rb +0 -15
- data/smoke/flow4.rb +0 -5
- data/smoke/flow5.rb +0 -20
- data/smoke/flow6.rb +0 -20
- data/smoke/flow7.rb +0 -21
- data/smoke/flow8.rb +0 -14
- data/smoke/flow9.rb +0 -12
- data/smoke/for.rb +0 -9
- data/smoke/freeze.rb +0 -12
- data/smoke/function.rb +0 -17
- data/smoke/gvar.rb +0 -14
- data/smoke/gvar2.rb +0 -15
- data/smoke/gvar2.rbs +0 -1
- data/smoke/hash-bot.rb +0 -12
- data/smoke/hash-fetch.rb +0 -28
- data/smoke/hash-merge-bang.rb +0 -12
- data/smoke/hash1.rb +0 -20
- data/smoke/hash2.rb +0 -13
- data/smoke/hash3.rb +0 -14
- data/smoke/hash4.rb +0 -11
- data/smoke/hash5.rb +0 -14
- data/smoke/huge_union.rb +0 -86
- data/smoke/identifier_keywords.rb +0 -17
- data/smoke/included.rb +0 -38
- data/smoke/inheritance.rb +0 -34
- data/smoke/inheritance2.rb +0 -35
- data/smoke/inherited.rb +0 -26
- data/smoke/initialize.rb +0 -28
- data/smoke/instance_eval.rb +0 -18
- data/smoke/instance_eval2.rb +0 -10
- data/smoke/instance_eval3.rb +0 -25
- data/smoke/instance_eval4.rb +0 -12
- data/smoke/int_times.rb +0 -15
- data/smoke/integer.rb +0 -11
- data/smoke/ivar.rb +0 -31
- data/smoke/ivar2.rb +0 -30
- data/smoke/ivar3.rb +0 -17
- data/smoke/ivar3.rbs +0 -3
- data/smoke/ivar4.rb +0 -21
- data/smoke/kernel-class.rb +0 -13
- data/smoke/keyword1.rb +0 -12
- data/smoke/keyword2.rb +0 -12
- data/smoke/keyword3.rb +0 -12
- data/smoke/keyword4.rb +0 -12
- data/smoke/keyword5.rb +0 -16
- data/smoke/kwrest.rb +0 -13
- data/smoke/kwrest.rbs +0 -3
- data/smoke/kwsplat1.rb +0 -43
- data/smoke/kwsplat2.rb +0 -13
- data/smoke/lit-complex.rb +0 -10
- data/smoke/lit-encoding.rb +0 -10
- data/smoke/manual-rbs.rb +0 -29
- data/smoke/manual-rbs.rbs +0 -3
- data/smoke/manual-rbs2.rb +0 -21
- data/smoke/manual-rbs2.rbs +0 -8
- data/smoke/manual-rbs3.rb +0 -13
- data/smoke/manual-rbs3.rbs +0 -3
- data/smoke/masgn1.rb +0 -14
- data/smoke/masgn2.rb +0 -18
- data/smoke/masgn3.rb +0 -13
- data/smoke/method_in_branch.rb +0 -23
- data/smoke/method_missing.rb +0 -29
- data/smoke/module1.rb +0 -29
- data/smoke/module2.rb +0 -28
- data/smoke/module3.rb +0 -33
- data/smoke/module4.rb +0 -35
- data/smoke/module5.rb +0 -17
- data/smoke/module6.rb +0 -40
- data/smoke/module_function1.rb +0 -29
- data/smoke/module_function2.rb +0 -29
- data/smoke/multiple-include.rb +0 -15
- data/smoke/multiple-superclass.rb +0 -28
- data/smoke/next1.rb +0 -21
- data/smoke/next2.rb +0 -17
- data/smoke/noname.rb +0 -9
- data/smoke/object-send1.rb +0 -23
- data/smoke/object-send2.rb +0 -10
- data/smoke/object-send3.rb +0 -18
- data/smoke/once.rb +0 -13
- data/smoke/optional1.rb +0 -14
- data/smoke/optional2.rb +0 -16
- data/smoke/optional3.rb +0 -11
- data/smoke/or_raise.rb +0 -18
- data/smoke/parameterizedd-self.rb +0 -20
- data/smoke/parameterizedd-self2.rb +0 -15
- data/smoke/pathname1.rb +0 -14
- data/smoke/pathname2.rb +0 -14
- data/smoke/pattern-match1.rb +0 -19
- data/smoke/pattern-match2.rb +0 -16
- data/smoke/prepend1.rb +0 -33
- data/smoke/prepend2.rb +0 -10
- data/smoke/prepend2.rbs +0 -9
- data/smoke/primitive_method.rb +0 -19
- data/smoke/printf.rb +0 -20
- data/smoke/proc.rb +0 -20
- data/smoke/proc2.rb +0 -17
- data/smoke/proc3.rb +0 -15
- data/smoke/proc4.rb +0 -12
- data/smoke/proc5.rb +0 -19
- data/smoke/proc6.rb +0 -13
- data/smoke/proc7.rb +0 -32
- data/smoke/public.rb +0 -38
- data/smoke/range.rb +0 -14
- data/smoke/rbs-alias.rb +0 -10
- data/smoke/rbs-alias.rbs +0 -4
- data/smoke/rbs-attr.rb +0 -27
- data/smoke/rbs-attr.rbs +0 -5
- data/smoke/rbs-attr2.rb +0 -11
- data/smoke/rbs-attr2.rbs +0 -3
- data/smoke/rbs-extend.rb +0 -10
- data/smoke/rbs-extend.rbs +0 -7
- data/smoke/rbs-interface.rb +0 -25
- data/smoke/rbs-interface.rbs +0 -12
- data/smoke/rbs-module.rb +0 -26
- data/smoke/rbs-module.rbs +0 -4
- data/smoke/rbs-opt-and-rest.rb +0 -10
- data/smoke/rbs-opt-and-rest.rbs +0 -3
- data/smoke/rbs-proc1.rb +0 -10
- data/smoke/rbs-proc1.rbs +0 -3
- data/smoke/rbs-proc2.rb +0 -21
- data/smoke/rbs-proc2.rbs +0 -3
- data/smoke/rbs-proc3.rb +0 -14
- data/smoke/rbs-proc3.rbs +0 -4
- data/smoke/rbs-record.rb +0 -18
- data/smoke/rbs-record.rbs +0 -4
- data/smoke/rbs-tyvar.rb +0 -19
- data/smoke/rbs-tyvar.rbs +0 -5
- data/smoke/rbs-tyvar2.rb +0 -21
- data/smoke/rbs-tyvar2.rbs +0 -9
- data/smoke/rbs-tyvar3.rb +0 -18
- data/smoke/rbs-tyvar3.rbs +0 -5
- data/smoke/rbs-tyvar4.rb +0 -37
- data/smoke/rbs-tyvar5.rb +0 -13
- data/smoke/rbs-tyvar5.rbs +0 -8
- data/smoke/rbs-tyvar6.rb +0 -18
- data/smoke/rbs-tyvar6.rbs +0 -12
- data/smoke/rbs-tyvar7.rb +0 -12
- data/smoke/rbs-tyvar7.rbs +0 -7
- data/smoke/rbs-vars.rb +0 -35
- data/smoke/rbs-vars.rbs +0 -7
- data/smoke/redo1.rb +0 -22
- data/smoke/redo2.rb +0 -23
- data/smoke/req-keyword.rb +0 -13
- data/smoke/require1.rb +0 -13
- data/smoke/require2.rb +0 -13
- data/smoke/rescue1.rb +0 -21
- data/smoke/rescue2.rb +0 -23
- data/smoke/rescue3.rb +0 -20
- data/smoke/rescue4.rb +0 -17
- data/smoke/respond_to.rb +0 -23
- data/smoke/rest-farg.rb +0 -11
- data/smoke/rest1.rb +0 -26
- data/smoke/rest2.rb +0 -31
- data/smoke/rest3.rb +0 -37
- data/smoke/rest4.rb +0 -19
- data/smoke/rest5.rb +0 -11
- data/smoke/rest6.rb +0 -12
- data/smoke/retry1.rb +0 -21
- data/smoke/return.rb +0 -14
- data/smoke/reveal.rb +0 -13
- data/smoke/simple.rb +0 -12
- data/smoke/singleton_class.rb +0 -8
- data/smoke/singleton_method.rb +0 -12
- data/smoke/step.rb +0 -18
- data/smoke/string-split.rb +0 -12
- data/smoke/struct-keyword_init.rb +0 -10
- data/smoke/struct.rb +0 -13
- data/smoke/struct2.rb +0 -25
- data/smoke/struct3.rb +0 -14
- data/smoke/struct4.rb +0 -7
- data/smoke/struct5.rb +0 -16
- data/smoke/struct6.rb +0 -15
- data/smoke/struct7.rb +0 -17
- data/smoke/stub-keyword.rb +0 -10
- data/smoke/super1.rb +0 -69
- data/smoke/super2.rb +0 -16
- data/smoke/super3.rb +0 -20
- data/smoke/super4.rb +0 -45
- data/smoke/super5.rb +0 -38
- data/smoke/svar1.rb +0 -13
- data/smoke/symbol-proc-attr.rb +0 -22
- data/smoke/symbol-proc-attr2.rb +0 -15
- data/smoke/symbol-proc-bot.rb +0 -13
- data/smoke/symbol-proc.rb +0 -25
- data/smoke/tap1.rb +0 -18
- data/smoke/toplevel.rb +0 -13
- data/smoke/two-map.rb +0 -18
- data/smoke/type_var.rb +0 -11
- data/smoke/typed_method.rb +0 -16
- data/smoke/uninitialize-var.rb +0 -13
- data/smoke/union-recv.rb +0 -35
- data/smoke/user-demo.rb +0 -15
- data/smoke/wrong-extend.rb +0 -27
- data/smoke/wrong-include.rb +0 -27
- data/smoke/wrong-include2.rb +0 -17
- data/smoke/wrong-rbs.rb +0 -15
- data/smoke/wrong-rbs.rbs +0 -7
- data/testbed/ao.rb +0 -297
- data/testbed/diff-lcs-entrypoint.rb +0 -4
- data/testbed/goodcheck-Gemfile.lock +0 -51
data/smoke/array-mul.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
def foo(a)
|
2
|
-
a * 3
|
3
|
-
end
|
4
|
-
|
5
|
-
def bar(a)
|
6
|
-
a * "join"
|
7
|
-
end
|
8
|
-
|
9
|
-
foo([1, 2, 3])
|
10
|
-
bar([1, 2, 3])
|
11
|
-
|
12
|
-
__END__
|
13
|
-
# Classes
|
14
|
-
class Object
|
15
|
-
private
|
16
|
-
def foo: ([Integer, Integer, Integer] a) -> Array[Integer]
|
17
|
-
def bar: ([Integer, Integer, Integer] a) -> String
|
18
|
-
end
|
data/smoke/array-plus1.rb
DELETED
data/smoke/array-plus2.rb
DELETED
data/smoke/array-pop.rb
DELETED
data/smoke/array-range-aref.rb
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
def f1(*ary)
|
2
|
-
ary[1..3]
|
3
|
-
end
|
4
|
-
|
5
|
-
def f2(*ary)
|
6
|
-
ary[1...3]
|
7
|
-
end
|
8
|
-
|
9
|
-
def f3(*ary)
|
10
|
-
ary[1..-3]
|
11
|
-
end
|
12
|
-
|
13
|
-
def f4(*ary)
|
14
|
-
ary[1...-3]
|
15
|
-
end
|
16
|
-
|
17
|
-
def f5(*ary)
|
18
|
-
ary[-4..3]
|
19
|
-
end
|
20
|
-
|
21
|
-
def f6(*ary)
|
22
|
-
ary[-4...3]
|
23
|
-
end
|
24
|
-
|
25
|
-
def f7(*ary)
|
26
|
-
ary[-4..-3]
|
27
|
-
end
|
28
|
-
|
29
|
-
def f8(*ary)
|
30
|
-
ary[-4...-3]
|
31
|
-
end
|
32
|
-
|
33
|
-
def f9(*ary)
|
34
|
-
ary[...3]
|
35
|
-
end
|
36
|
-
|
37
|
-
def f10(*ary)
|
38
|
-
ary[3..]
|
39
|
-
end
|
40
|
-
|
41
|
-
def dispatch(*ary)
|
42
|
-
f1(*ary)
|
43
|
-
f2(*ary)
|
44
|
-
f3(*ary)
|
45
|
-
f4(*ary)
|
46
|
-
f5(*ary)
|
47
|
-
f6(*ary)
|
48
|
-
f7(*ary)
|
49
|
-
f8(*ary)
|
50
|
-
f9(*ary)
|
51
|
-
f10(*ary)
|
52
|
-
end
|
53
|
-
|
54
|
-
dispatch(:a, :b, :c, :d, :e)
|
55
|
-
|
56
|
-
__END__
|
57
|
-
# Classes
|
58
|
-
class Object
|
59
|
-
private
|
60
|
-
def f1: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
61
|
-
def f2: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
62
|
-
def f3: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
63
|
-
def f4: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
64
|
-
def f5: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
65
|
-
def f6: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
66
|
-
def f7: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
67
|
-
def f8: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
68
|
-
def f9: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
69
|
-
def f10: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
70
|
-
def dispatch: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
71
|
-
end
|
data/smoke/array-replace.rb
DELETED
data/smoke/array-s-aref.rb
DELETED
data/smoke/array1.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
def foo(a)
|
2
|
-
a[0]
|
3
|
-
end
|
4
|
-
def bar(n); end
|
5
|
-
def baz(n); end
|
6
|
-
def qux(n); end
|
7
|
-
def quux(n); end
|
8
|
-
|
9
|
-
a = [42, "str"]
|
10
|
-
foo(a)
|
11
|
-
bar(a[0])
|
12
|
-
n = 1
|
13
|
-
baz(a[n])
|
14
|
-
qux(a[2])
|
15
|
-
n = 0+0
|
16
|
-
quux(a[n])
|
17
|
-
|
18
|
-
__END__
|
19
|
-
# Classes
|
20
|
-
class Object
|
21
|
-
private
|
22
|
-
def foo: ([Integer, String] a) -> Integer
|
23
|
-
def bar: (Integer n) -> nil
|
24
|
-
def baz: (String n) -> nil
|
25
|
-
def qux: (nil n) -> nil
|
26
|
-
def quux: (Integer | String n) -> nil
|
27
|
-
end
|
data/smoke/array10.rb
DELETED
data/smoke/array11.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
def array(obj)
|
2
|
-
Array(obj)
|
3
|
-
end
|
4
|
-
|
5
|
-
array({1=>1})
|
6
|
-
array([1]+[2])
|
7
|
-
array("foo")
|
8
|
-
|
9
|
-
__END__
|
10
|
-
# Classes
|
11
|
-
class Object
|
12
|
-
private
|
13
|
-
def array: (Array[Integer] | Hash[Integer, Integer] | String obj) -> (Array[Hash[Integer, Integer] | Integer | String])
|
14
|
-
end
|
data/smoke/array12.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
def bar(x)
|
2
|
-
end
|
3
|
-
|
4
|
-
def test_yield
|
5
|
-
yield
|
6
|
-
end
|
7
|
-
|
8
|
-
def foo
|
9
|
-
a = [1]
|
10
|
-
test_yield do
|
11
|
-
bar(a)
|
12
|
-
end
|
13
|
-
a
|
14
|
-
end
|
15
|
-
|
16
|
-
foo
|
17
|
-
|
18
|
-
__END__
|
19
|
-
# Classes
|
20
|
-
class Object
|
21
|
-
private
|
22
|
-
def bar: ([Integer] x) -> nil
|
23
|
-
def test_yield: { -> nil } -> nil
|
24
|
-
def foo: -> [Integer]
|
25
|
-
end
|
data/smoke/array13.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
def tuple_set
|
2
|
-
ary = [:a, :b, :c]
|
3
|
-
ary[-1] = :z
|
4
|
-
ary
|
5
|
-
end
|
6
|
-
|
7
|
-
def tuple_get
|
8
|
-
ary = [:a, :b, :c]
|
9
|
-
ary[-1]
|
10
|
-
end
|
11
|
-
|
12
|
-
def seq_set
|
13
|
-
ary = [:a, :b, :c] + []
|
14
|
-
ary[-1] = :z
|
15
|
-
ary
|
16
|
-
end
|
17
|
-
|
18
|
-
def seq_get
|
19
|
-
ary = [:a, :b, :c] + []
|
20
|
-
ary[-1]
|
21
|
-
end
|
22
|
-
|
23
|
-
__END__
|
24
|
-
# Classes
|
25
|
-
class Object
|
26
|
-
private
|
27
|
-
def tuple_set: -> [:a, :b, :z]
|
28
|
-
def tuple_get: -> :c
|
29
|
-
def seq_set: -> (Array[:a | :b | :c | :z])
|
30
|
-
def seq_get: -> (:a | :b | :c)
|
31
|
-
end
|
data/smoke/array14.rb
DELETED
data/smoke/array15.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
class Foo
|
2
|
-
def []=(*args)
|
3
|
-
ary = []
|
4
|
-
val = args[-1]
|
5
|
-
ary[*args[0..-2]] = val # TODO: there is room to improve array_aset
|
6
|
-
ary # This should be Array[String]
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
Foo.new[1] = "str"
|
11
|
-
|
12
|
-
__END__
|
13
|
-
# Classes
|
14
|
-
class Foo
|
15
|
-
def []=: (*Integer | String args) -> Array[bot]
|
16
|
-
end
|
data/smoke/array2.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
def foo
|
2
|
-
a = [[42]]
|
3
|
-
a[0][0] = "str"
|
4
|
-
a
|
5
|
-
end
|
6
|
-
|
7
|
-
def bar(a)
|
8
|
-
a[0][0] = "str"
|
9
|
-
a
|
10
|
-
end
|
11
|
-
|
12
|
-
def log(a)
|
13
|
-
end
|
14
|
-
|
15
|
-
foo
|
16
|
-
a = [[42]]
|
17
|
-
bar(a)
|
18
|
-
# limitation: a is kept as [[Integer]]
|
19
|
-
log(a)
|
20
|
-
|
21
|
-
__END__
|
22
|
-
# Classes
|
23
|
-
class Object
|
24
|
-
private
|
25
|
-
def foo: -> [[String]]
|
26
|
-
def bar: ([[Integer]] a) -> [[String]]
|
27
|
-
def log: ([[Integer]] a) -> nil
|
28
|
-
end
|
data/smoke/array3.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
class Foo
|
2
|
-
def initialize
|
3
|
-
@ary = [1, "str", :sym]
|
4
|
-
end
|
5
|
-
|
6
|
-
def foo
|
7
|
-
@ary[1]
|
8
|
-
end
|
9
|
-
|
10
|
-
def bar
|
11
|
-
@ary[1] = nil
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
Foo.new.foo
|
16
|
-
Foo.new.bar
|
17
|
-
|
18
|
-
__END__
|
19
|
-
# Classes
|
20
|
-
class Foo
|
21
|
-
@ary: [Integer, String?, :sym]
|
22
|
-
|
23
|
-
def initialize: -> void
|
24
|
-
def foo: -> String?
|
25
|
-
def bar: -> nil
|
26
|
-
end
|
data/smoke/array4.rb
DELETED
data/smoke/array5.rb
DELETED
data/smoke/array6.rb
DELETED
data/smoke/array7.rb
DELETED
data/smoke/array8.rb
DELETED
data/smoke/array9.rb
DELETED
data/smoke/attr-module.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
module Foo
|
2
|
-
attr_accessor :foo
|
3
|
-
module_function :foo=, :foo
|
4
|
-
end
|
5
|
-
|
6
|
-
class Bar
|
7
|
-
include Foo
|
8
|
-
end
|
9
|
-
|
10
|
-
Foo.foo = 42
|
11
|
-
Bar.new.foo = "str"
|
12
|
-
|
13
|
-
__END__
|
14
|
-
# Classes
|
15
|
-
module Foo
|
16
|
-
self.@foo: Integer
|
17
|
-
|
18
|
-
attr_accessor foo: String
|
19
|
-
attr_accessor self.foo: Integer
|
20
|
-
end
|
21
|
-
|
22
|
-
class Bar
|
23
|
-
include Foo
|
24
|
-
end
|
data/smoke/attr-vis.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
class Foo
|
2
|
-
def initialize
|
3
|
-
@foo = 42
|
4
|
-
end
|
5
|
-
|
6
|
-
private
|
7
|
-
attr_accessor :foo
|
8
|
-
|
9
|
-
public
|
10
|
-
def get_foo
|
11
|
-
foo
|
12
|
-
end
|
13
|
-
def set_foo(arg)
|
14
|
-
self.foo = arg
|
15
|
-
end
|
16
|
-
def get_bar
|
17
|
-
bar
|
18
|
-
end
|
19
|
-
def set_bar(arg)
|
20
|
-
self.bar = arg
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
Foo.new.set_foo("str")
|
25
|
-
Foo.new.set_bar("str")
|
26
|
-
|
27
|
-
__END__
|
28
|
-
# Errors
|
29
|
-
smoke/attr-vis.rb:20: [warning] inconsistent assignment to RBS-declared variable
|
30
|
-
|
31
|
-
# Classes
|
32
|
-
class Foo
|
33
|
-
def initialize: -> void
|
34
|
-
|
35
|
-
private
|
36
|
-
attr_accessor foo: Integer | String
|
37
|
-
|
38
|
-
public
|
39
|
-
def get_foo: -> (Integer | String)
|
40
|
-
def set_foo: (String arg) -> String
|
41
|
-
def get_bar: -> Integer
|
42
|
-
def set_bar: (String arg) -> String
|
43
|
-
end
|
data/smoke/attr-vis.rbs
DELETED
data/smoke/attr.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
class Foo
|
2
|
-
def initialize(a)
|
3
|
-
@a = a
|
4
|
-
end
|
5
|
-
attr_reader :a
|
6
|
-
|
7
|
-
attr_writer :b
|
8
|
-
def get_b
|
9
|
-
@b
|
10
|
-
end
|
11
|
-
|
12
|
-
attr_accessor :c
|
13
|
-
end
|
14
|
-
|
15
|
-
foo = Foo.new(:aaa)
|
16
|
-
foo.b = :bbb
|
17
|
-
foo.get_b
|
18
|
-
foo.c = :ccc
|
19
|
-
|
20
|
-
__END__
|
21
|
-
# Classes
|
22
|
-
class Foo
|
23
|
-
def initialize: (:aaa a) -> void
|
24
|
-
attr_reader a: :aaa
|
25
|
-
attr_writer b: :bbb
|
26
|
-
def get_b: -> :bbb
|
27
|
-
attr_accessor c: :ccc
|
28
|
-
end
|
data/smoke/autoload.rb
DELETED
data/smoke/backtrace.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
def foo
|
2
|
-
unknown_method
|
3
|
-
end
|
4
|
-
|
5
|
-
def bar
|
6
|
-
foo
|
7
|
-
end
|
8
|
-
|
9
|
-
def baz
|
10
|
-
bar
|
11
|
-
end
|
12
|
-
|
13
|
-
baz
|
14
|
-
|
15
|
-
# smoke/backtrace.rb:2: [error] undefined method: Object#unknown_method
|
16
|
-
# from smoke/backtrace.rb:6
|
17
|
-
# from smoke/backtrace.rb:10
|
18
|
-
# from smoke/backtrace.rb:13
|
19
|
-
# Object#baz :: () -> any
|
20
|
-
# Object#bar :: () -> any
|
21
|
-
# Object#foo :: () -> any
|
22
|
-
|
23
|
-
__END__
|
24
|
-
# Errors
|
25
|
-
smoke/backtrace.rb:2: [error] undefined method: Object#unknown_method
|
26
|
-
|
27
|
-
# Classes
|
28
|
-
class Object
|
29
|
-
private
|
30
|
-
def foo: -> untyped
|
31
|
-
def bar: -> untyped
|
32
|
-
def baz: -> untyped
|
33
|
-
end
|
data/smoke/block-ambiguous.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
def f1
|
2
|
-
yield :a, :b, :c
|
3
|
-
end
|
4
|
-
def log1(x); end
|
5
|
-
f1 {|x| log1(x) }
|
6
|
-
|
7
|
-
def f2
|
8
|
-
yield :a, :b, :c
|
9
|
-
end
|
10
|
-
def log2(x); end
|
11
|
-
f2 {|x,| log2(x) }
|
12
|
-
|
13
|
-
def f3
|
14
|
-
yield [:a, :b, :c]
|
15
|
-
end
|
16
|
-
def log3(x); end
|
17
|
-
f3 {|x| log3(x) }
|
18
|
-
|
19
|
-
def f4
|
20
|
-
yield [:a, :b, :c]
|
21
|
-
end
|
22
|
-
def log4(x); end
|
23
|
-
f4 {|x,| log4(x) }
|
24
|
-
|
25
|
-
__END__
|
26
|
-
# Classes
|
27
|
-
class Object
|
28
|
-
private
|
29
|
-
def f1: { (:a, :b, :c) -> nil } -> nil
|
30
|
-
def log1: (:a x) -> nil
|
31
|
-
def f2: { (:a, :b, :c) -> nil } -> nil
|
32
|
-
def log2: (:a x) -> nil
|
33
|
-
def f3: { ([:a, :b, :c]) -> nil } -> nil
|
34
|
-
def log3: ([:a, :b, :c] x) -> nil
|
35
|
-
def f4: { ([:a, :b, :c]) -> nil } -> nil
|
36
|
-
def log4: (:a x) -> nil
|
37
|
-
end
|