rdl 2.1.0 → 2.2.0
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.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +7 -6
- data/CHANGES.md +29 -0
- data/README.md +94 -26
- data/lib/rdl/boot.rb +82 -41
- data/lib/rdl/boot_rails.rb +5 -0
- data/lib/rdl/config.rb +9 -1
- data/lib/rdl/query.rb +2 -2
- data/lib/rdl/typecheck.rb +972 -225
- data/lib/rdl/types/annotated_arg.rb +8 -0
- data/lib/rdl/types/ast_node.rb +73 -0
- data/lib/rdl/types/bot.rb +8 -0
- data/lib/rdl/types/bound_arg.rb +63 -0
- data/lib/rdl/types/computed.rb +48 -0
- data/lib/rdl/types/dependent_arg.rb +9 -0
- data/lib/rdl/types/dynamic.rb +61 -0
- data/lib/rdl/types/finite_hash.rb +54 -9
- data/lib/rdl/types/generic.rb +33 -0
- data/lib/rdl/types/intersection.rb +8 -0
- data/lib/rdl/types/lexer.rex +6 -1
- data/lib/rdl/types/lexer.rex.rb +13 -1
- data/lib/rdl/types/method.rb +14 -0
- data/lib/rdl/types/nominal.rb +8 -0
- data/lib/rdl/types/non_null.rb +8 -0
- data/lib/rdl/types/optional.rb +8 -0
- data/lib/rdl/types/parser.racc +31 -5
- data/lib/rdl/types/parser.tab.rb +540 -302
- data/lib/rdl/types/rdl_types.rb +45 -0
- data/lib/rdl/types/singleton.rb +14 -1
- data/lib/rdl/types/string.rb +104 -0
- data/lib/rdl/types/structural.rb +8 -0
- data/lib/rdl/types/top.rb +8 -0
- data/lib/rdl/types/tuple.rb +32 -8
- data/lib/rdl/types/type.rb +54 -11
- data/lib/rdl/types/union.rb +41 -2
- data/lib/rdl/types/var.rb +10 -0
- data/lib/rdl/types/vararg.rb +8 -0
- data/lib/rdl/util.rb +13 -10
- data/lib/rdl/wrap.rb +271 -27
- data/lib/rdl_disable.rb +16 -2
- data/lib/types/active_record.rb +1 -0
- data/lib/types/core/array.rb +442 -23
- data/lib/types/core/basic_object.rb +3 -3
- data/lib/types/core/bigdecimal.rb +5 -0
- data/lib/types/core/class.rb +2 -0
- data/lib/types/core/dir.rb +3 -3
- data/lib/types/core/enumerable.rb +4 -4
- data/lib/types/core/enumerator.rb +1 -1
- data/lib/types/core/file.rb +4 -4
- data/lib/types/core/float.rb +203 -0
- data/lib/types/core/hash.rb +390 -15
- data/lib/types/core/integer.rb +223 -10
- data/lib/types/core/io.rb +2 -2
- data/lib/types/core/kernel.rb +8 -5
- data/lib/types/core/marshal.rb +3 -0
- data/lib/types/core/module.rb +3 -3
- data/lib/types/core/numeric.rb +0 -2
- data/lib/types/core/object.rb +5 -5
- data/lib/types/core/pathname.rb +2 -2
- data/lib/types/core/process.rb +1 -3
- data/lib/types/core/range.rb +1 -1
- data/lib/types/core/regexp.rb +2 -2
- data/lib/types/core/set.rb +1 -1
- data/lib/types/core/string.rb +408 -16
- data/lib/types/core/symbol.rb +3 -3
- data/lib/types/core/time.rb +1 -1
- data/lib/types/core/uri.rb +13 -13
- data/lib/types/rails/_helpers.rb +7 -1
- data/lib/types/rails/action_controller/mime_responds.rb +2 -0
- data/lib/types/rails/active_record/associations.rb +42 -30
- data/lib/types/rails/active_record/comp_types.rb +637 -0
- data/lib/types/rails/active_record/finder_methods.rb +1 -1
- data/lib/types/rails/active_record/model_schema.rb +28 -16
- data/lib/types/rails/active_record/relation.rb +5 -3
- data/lib/types/rails/active_record/sql-strings.rb +166 -0
- data/lib/types/rails/string.rb +1 -1
- data/lib/types/sequel.rb +1 -0
- data/lib/types/sequel/comp_types.rb +581 -0
- data/rdl.gemspec +5 -4
- data/test/test_alias.rb +4 -0
- data/test/test_array_types.rb +244 -0
- data/test/test_bound_types.rb +80 -0
- data/test/test_contract.rb +4 -0
- data/test/test_dsl.rb +5 -0
- data/test/test_dyn_comptype_checks.rb +206 -0
- data/test/test_generic.rb +21 -20
- data/test/test_hash_types.rb +322 -0
- data/test/test_intersection.rb +1 -0
- data/test/test_le.rb +29 -4
- data/test/test_member.rb +3 -1
- data/test/test_parser.rb +5 -0
- data/test/test_query.rb +1 -0
- data/test/test_rdl.rb +63 -28
- data/test/test_rdl_type.rb +4 -0
- data/test/test_string_types.rb +102 -0
- data/test/test_type_contract.rb +59 -37
- data/test/test_typecheck.rb +480 -75
- data/test/test_types.rb +17 -0
- data/test/test_wrap.rb +5 -0
- metadata +35 -5
- data/lib/types/rails/active_record/schema_types.rb +0 -51
data/lib/types/core/integer.rb
CHANGED
@@ -1,5 +1,218 @@
|
|
1
1
|
RDL.nowrap :Integer
|
2
2
|
|
3
|
+
def Numeric.sing_or_type(trec, targs, meth, type)
|
4
|
+
if trec.is_a?(RDL::Type::SingletonType) && (targs.empty? || targs[0].is_a?(RDL::Type::SingletonType))
|
5
|
+
#puts "We have reached the constant folding case for method #{meth}, receiver type #{trec}, and argument types #{targs}."
|
6
|
+
if targs[0]
|
7
|
+
v = RDL.type_cast(RDL.type_cast(trec, "RDL::Type::SingletonType<Integer>").val.send(meth, RDL.type_cast(targs[0], "RDL::Type::SingletonType").val), "Integer", force: true)
|
8
|
+
else
|
9
|
+
v = RDL.type_cast(RDL.type_cast(trec, "RDL::Type::SingletonType<Integer>").val.send(meth), "Integer", force: true)
|
10
|
+
end
|
11
|
+
RDL::Type::SingletonType.new(v.__getobj__)
|
12
|
+
else
|
13
|
+
RDL::Globals.parser.scan_str "#T #{type}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
RDL.type Numeric, 'self.sing_or_type', "(RDL::Type::Type, Array<RDL::Type::Type>, Symbol, String) -> RDL::Type::Type", typecheck: :type_code, wrap: false, effect: [:~, :+]
|
17
|
+
|
18
|
+
|
19
|
+
RDL.type :Integer, :%, '(Integer x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :%, "Integer")``'
|
20
|
+
RDL.type :Integer, :%, '(Float x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :%, "Float")``'
|
21
|
+
RDL.type :Integer, :%, '(Rational x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :%, "Rational")``'
|
22
|
+
RDL.type :Integer, :%, '(BigDecimal x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :%, "BigDecimal")``'
|
23
|
+
|
24
|
+
RDL.type :Integer, :&, '(Integer) -> ``sing_or_type(trec, targs, :&, "Integer")``'
|
25
|
+
|
26
|
+
RDL.type :Integer, :*, '(Integer) -> ``sing_or_type(trec, targs, :*, "Integer")``'
|
27
|
+
RDL.type :Integer, :*, '(Float) -> ``sing_or_type(trec, targs, :*, "Float")``'
|
28
|
+
RDL.type :Integer, :*, '(Rational) -> ``sing_or_type(trec, targs, :*, "Rational")``'
|
29
|
+
RDL.type :Integer, :*, '(BigDecimal) -> ``sing_or_type(trec, targs, :*, "BigDecimal")``'
|
30
|
+
RDL.type :Integer, :*, '(Complex) -> ``sing_or_type(trec, targs, :*, "Complex")``'
|
31
|
+
RDL.pre(:Integer, :*) { |x| if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end} #can't have a complex with part BigDecimal, other part infinity/NAN
|
32
|
+
|
33
|
+
RDL.type :Integer, :**, '(Integer) -> ``sing_or_type(trec, targs, :**, "%numeric")``'
|
34
|
+
RDL.type :Integer, :**, '(Float) -> ``sing_or_type(trec, targs, :**, "%numeric")``'
|
35
|
+
RDL.type :Integer, :**, '(Rational) -> ``sing_or_type(trec, targs, :**, "%numeric")``'
|
36
|
+
RDL.type :Integer, :**, '(BigDecimal) -> ``sing_or_type(trec, targs, :**, "BigDecimal")``'
|
37
|
+
RDL.pre(:Integer, :**) { |x| x!=BigDecimal::INFINITY && if self<0 then x<=-1||x>=0 else true end}
|
38
|
+
RDL.post(:Integer, :**) { |r,x| r.real?}
|
39
|
+
RDL.type :Integer, :**, '(Complex) -> ``sing_or_type(trec, targs, :**, "Complex")``'
|
40
|
+
RDL.pre(:Integer, :**) { |x| x!=0 && if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end}
|
41
|
+
|
42
|
+
RDL.type :Integer, :+, '(Integer) -> ``sing_or_type(trec, targs, :+, "Integer")``'
|
43
|
+
RDL.type :Integer, :+, '(Float) -> ``sing_or_type(trec, targs, :+, "Float")``'
|
44
|
+
RDL.type :Integer, :+, '(Rational) -> ``sing_or_type(trec, targs, :+, "Rational")``'
|
45
|
+
RDL.type :Integer, :+, '(BigDecimal) -> ``sing_or_type(trec, targs, :+, "BigDecimal")``'
|
46
|
+
RDL.type :Integer, :+, '(Complex) -> ``sing_or_type(trec, targs, :+, "Complex")``'
|
47
|
+
|
48
|
+
RDL.type :Integer, :-, '(Integer) -> ``sing_or_type(trec, targs, :-, "Integer")``'
|
49
|
+
RDL.type :Integer, :-, '(Float) -> ``sing_or_type(trec, targs, :-, "Float")``'
|
50
|
+
RDL.type :Integer, :-, '(Rational) -> ``sing_or_type(trec, targs, :-, "Rational")``'
|
51
|
+
RDL.type :Integer, :-, '(BigDecimal) -> ``sing_or_type(trec, targs, :-, "BigDecimal")``'
|
52
|
+
RDL.type :Integer, :-, '(Complex) -> ``sing_or_type(trec, targs, :-, "Complex")``'
|
53
|
+
|
54
|
+
RDL.type :Integer, :-@, '() -> ``sing_or_type(trec, targs, :-@, "Integer")``'
|
55
|
+
|
56
|
+
RDL.type :Integer, :+@, '() -> ``sing_or_type(trec, targs, :-@, "Integer")``'
|
57
|
+
|
58
|
+
RDL.type :Integer, :/, '(Integer x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :/, "Integer")``'
|
59
|
+
RDL.type :Integer, :/, '(Float x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :/, "Float")``'
|
60
|
+
RDL.type :Integer, :/, '(Rational x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :/, "Rational")``'
|
61
|
+
RDL.type :Integer, :/, '(BigDecimal x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :/, "BigDecimal")``'
|
62
|
+
RDL.type :Integer, :/, '(Complex x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :/, "Complex")``'
|
63
|
+
RDL.pre(:Integer, :/) { |x| x!=0 && if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end && if (x.real.is_a?(Rational) && x.imaginary.is_a?(Float)) then !x.imaginary.nan? else true end}
|
64
|
+
|
65
|
+
RDL.type :Integer, :<, '(Integer) -> ``sing_or_type(trec, targs, :<, "%bool")``', effect: [:+, :+]
|
66
|
+
RDL.type :Integer, :<, '(Float) -> ``sing_or_type(trec, targs, :<, "%bool")``', effect: [:+, :+]
|
67
|
+
RDL.type :Integer, :<, '(Rational) -> ``sing_or_type(trec, targs, :<, "%bool")``', effect: [:+, :+]
|
68
|
+
RDL.type :Integer, :<, '(BigDecimal) -> ``sing_or_type(trec, targs, :<, "%bool")``', effect: [:+, :+]
|
69
|
+
|
70
|
+
RDL.type :Integer, :<<, '(Integer) -> ``sing_or_type(trec, targs, :<<, "Integer")``'
|
71
|
+
|
72
|
+
RDL.type :Integer, :<=, '(Integer) -> ``sing_or_type(trec, targs, :<=, "%bool")``', effect: [:+, :+]
|
73
|
+
RDL.type :Integer, :<=, '(Float) -> ``sing_or_type(trec, targs, :<=, "%bool")``', effect: [:+, :+]
|
74
|
+
RDL.type :Integer, :<=, '(Rational) -> ``sing_or_type(trec, targs, :<=, "%bool")``', effect: [:+, :+]
|
75
|
+
RDL.type :Integer, :<=, '(BigDecimal) -> ``sing_or_type(trec, targs, :<=, "%bool")``', effect: [:+, :+]
|
76
|
+
|
77
|
+
RDL.type :Integer, :<=>, '(Integer) -> ``sing_or_type(trec, targs, :<=>, "Integer")``'
|
78
|
+
RDL.post(:Integer, :<=>) { |r,x| r == -1 || r == 0 || r == 1 }
|
79
|
+
RDL.type :Integer, :<=>, '(Float) -> ``sing_or_type(trec, targs, :<=>, "Integer")``'
|
80
|
+
RDL.post(:Integer, :<=>) { |r,x| r == -1 || r == 0 || r == 1 }
|
81
|
+
RDL.type :Integer, :<=>, '(Rational) -> ``sing_or_type(trec, targs, :<=>, "Integer")``'
|
82
|
+
RDL.post(:Integer, :<=>) { |r,x| r == -1 || r == 0 || r == 1 }
|
83
|
+
RDL.type :Integer, :<=>, '(BigDecimal) -> ``sing_or_type(trec, targs, :<=>, "Integer")``'
|
84
|
+
RDL.post(:Integer, :<=>) { |r,x| r == -1 || r == 0 || r == 1 }
|
85
|
+
|
86
|
+
RDL.type :Integer, :==, '(Object) -> ``sing_or_type(trec, targs, :==, "%bool")``'
|
87
|
+
|
88
|
+
RDL.type :Integer, :===, '(Object) -> ``sing_or_type(trec, targs, :===, "%bool")``'
|
89
|
+
|
90
|
+
RDL.type :Integer, :>, '(Integer) -> ``sing_or_type(trec, targs, :>, "%bool")``', effect: [:+, :+]
|
91
|
+
RDL.type :Integer, :>, '(Float) -> ``sing_or_type(trec, targs, :>, "%bool")``', effect: [:+, :+]
|
92
|
+
RDL.type :Integer, :>, '(Rational) -> ``sing_or_type(trec, targs, :>, "%bool")``', effect: [:+, :+]
|
93
|
+
RDL.type :Integer, :>, '(BigDecimal) -> ``sing_or_type(trec, targs, :>, "%bool")``', effect: [:+, :+]
|
94
|
+
|
95
|
+
RDL.type :Integer, :>=, '(Integer) -> ``sing_or_type(trec, targs, :>=, "%bool")``', effect: [:+, :+]
|
96
|
+
RDL.type :Integer, :>=, '(Float) -> ``sing_or_type(trec, targs, :>=, "%bool")``', effect: [:+, :+]
|
97
|
+
RDL.type :Integer, :>=, '(Rational) -> ``sing_or_type(trec, targs, :>=, "%bool")``', effect: [:+, :+]
|
98
|
+
RDL.type :Integer, :>=, '(BigDecimal) -> ``sing_or_type(trec, targs, :>=, "%bool")``', effect: [:+, :+]
|
99
|
+
|
100
|
+
RDL.type :Integer, :>>, '(Integer) -> Integer r {{ r >= 0 }}' ## TODO
|
101
|
+
|
102
|
+
RDL.type :Integer, :[], '(Integer) -> ``sing_or_type(trec, targs, :[], "Integer")``'
|
103
|
+
RDL.post(:Integer, :[]) { |r,x| r == 0 || r==1}
|
104
|
+
RDL.type :Integer, :[], '(Rational) -> ``sing_or_type(trec, targs, :[], "Integer")``'
|
105
|
+
RDL.post(:Integer, :[]) { |r,x| r == 0 || r==1}
|
106
|
+
RDL.type :Integer, :[], '(Float) -> ``sing_or_type(trec, targs, :[], "Integer")``'
|
107
|
+
RDL.pre(:Integer, :[]) { |x| x != Float::INFINITY && !x.nan? }
|
108
|
+
RDL.post(:Integer, :[]) { |r,x| r == 0 || r==1}
|
109
|
+
RDL.type :Integer, :[], '(BigDecimal) -> ``sing_or_type(trec, targs, :[], "Integer")``'
|
110
|
+
RDL.pre(:Integer, :[]) { |x| x != BigDecimal::INFINITY && !x.nan? }
|
111
|
+
RDL.post(:Integer, :[]) { |r,x| r == 0 || r == 1 }
|
112
|
+
|
113
|
+
RDL.type :Integer, :^, '(Integer) -> ``sing_or_type(trec, targs, :^, "Integer")``'
|
114
|
+
|
115
|
+
RDL.type :Integer, :|, '(Integer) -> ``sing_or_type(trec, targs, :|, "Integer")``'
|
116
|
+
|
117
|
+
RDL.type :Integer, :~, '() -> ``sing_or_type(trec, targs, :~, "Integer")``'
|
118
|
+
|
119
|
+
RDL.type :Integer, :abs, '() -> Integer r {{ r>=0 }}' ## TODO
|
120
|
+
|
121
|
+
RDL.type :Integer, :bit_length, '() -> Integer r {{ r>=0 }}' ## TODO
|
122
|
+
|
123
|
+
RDL.type :Integer, :div, '(Integer x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :div, "Integer")``'
|
124
|
+
RDL.type :Integer, :div, '(Float x {{ x!=0 && !x.nan? }}) -> ``sing_or_type(trec, targs, :div, "Integer")``'
|
125
|
+
RDL.type :Integer, :div, '(Rational x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :div, "Integer")``'
|
126
|
+
RDL.type :Integer, :div, '(BigDecimal x {{ x!=0 && !x.nan? }}) -> ``sing_or_type(trec, targs, :div, "Integer")``'
|
127
|
+
|
128
|
+
RDL.type :Integer, :divmod, '(%real x {{ x!=0 }}) -> [%real, %real]'
|
129
|
+
RDL.pre(:Integer, :divmod) { |x| if x.is_a?(Float) then !x.nan? else true end}
|
130
|
+
|
131
|
+
RDL.type :Integer, :fdiv, '(Integer) -> ``sing_or_type(trec, targs, :fdiv, "Float")``'
|
132
|
+
RDL.type :Integer, :fdiv, '(Float) -> ``sing_or_type(trec, targs, :fdiv, "Float")``'
|
133
|
+
RDL.type :Integer, :fdiv, '(Rational) -> ``sing_or_type(trec, targs, :fdiv, "Float")``'
|
134
|
+
RDL.type :Integer, :fdiv, '(BigDecimal) -> ``sing_or_type(trec, targs, :fdiv, "BigDecimal")``'
|
135
|
+
RDL.type :Integer, :fdiv, '(Complex) -> ``sing_or_type(trec, targs, :fdiv, "Complex")``'
|
136
|
+
RDL.pre(:Integer, :fdiv) { |x| if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end && if (x.real.is_a?(Rational) && x.imaginary.is_a?(Float)) then !x.imaginary.nan? else true end}
|
137
|
+
|
138
|
+
RDL.type :Integer, :to_s, '() -> String'
|
139
|
+
RDL.type :Integer, :inspect, '() -> String'
|
140
|
+
|
141
|
+
RDL.type :Integer, :magnitude, '() -> Integer r {{ r>=0 }}' ## TODO
|
142
|
+
|
143
|
+
RDL.type :Integer, :modulo, '(Integer x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :modulo, "Integer")``'
|
144
|
+
RDL.type :Integer, :modulo, '(Float x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :modulo, "Float")``'
|
145
|
+
RDL.type :Integer, :modulo, '(Rational x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :modulo, "Rational")``'
|
146
|
+
RDL.type :Integer, :modulo, '(BigDecimal x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :modulo, "BigDecimal")``'
|
147
|
+
|
148
|
+
RDL.type :Integer, :quo, '(Integer x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :quo, "Integer")``'
|
149
|
+
RDL.type :Integer, :quo, '(Float x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :quo, "Float")``'
|
150
|
+
RDL.type :Integer, :quo, '(Rational x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :quo, "Rational")``'
|
151
|
+
RDL.type :Integer, :quo, '(BigDecimal x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :quo, "BigDecimal")``'
|
152
|
+
RDL.type :Integer, :quo, '(Complex x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :quo, "Complex")``'
|
153
|
+
RDL.pre(:Integer, :quo) { |x| if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end && if (x.real.is_a?(Rational) && x.imaginary.is_a?(Float)) then !x.imaginary.nan? else true end}
|
154
|
+
|
155
|
+
RDL.type :Integer, :abs2, '() -> Integer r {{ r>=0 }}' ## TODO
|
156
|
+
RDL.type :Integer, :angle, '() -> ``sing_or_type(trec, targs, :angle, "%numeric")``'
|
157
|
+
RDL.post(:Integer, :angle) { |r,x| r == 0 || r == Math::PI}
|
158
|
+
RDL.type :Integer, :arg, '() -> ``sing_or_type(trec, targs, :arg, "%numeric")``'
|
159
|
+
RDL.post(:Integer, :arg) { |r,x| r == 0 || r == Math::PI}
|
160
|
+
RDL.type :Integer, :equal?, '(Object) -> ``sing_or_type(trec, targs, :equal?, "%bool")``'
|
161
|
+
RDL.type :Integer, :eql?, '(Object) -> ``sing_or_type(trec, targs, :eql?, "%bool")``'
|
162
|
+
RDL.type :Integer, :hash, '() -> Integer'
|
163
|
+
RDL.type :Integer, :ceil, '() -> ``sing_or_type(trec, targs, :ceil, "Integer")``'
|
164
|
+
RDL.type :Integer, :chr, '(Encoding) -> String'
|
165
|
+
RDL.type :Integer, :coerce, '(%numeric) -> [%real, %real]'
|
166
|
+
RDL.pre(:Integer, :coerce) { |x| if x.is_a?(Complex) then x.imaginary==0 else true end}
|
167
|
+
RDL.type :Integer, :conj, '() -> ``sing_or_type(trec, targs, :conj, "Integer")``'
|
168
|
+
RDL.type :Integer, :conjugate, '() -> ``sing_or_type(trec, targs, :conjugate, "Integer")``'
|
169
|
+
RDL.type :Integer, :denominator, '() -> ``sing_or_type(trec, targs, :denominator, "Integer")``'
|
170
|
+
RDL.post(:Integer, :denominator) { |r,x| r == 1 }
|
171
|
+
RDL.type :Integer, :downto, '(Integer) { (Integer) -> %any } -> Integer'
|
172
|
+
RDL.type :Integer, :downto, '(Integer limit) -> Enumerator<Integer>'
|
173
|
+
RDL.type :Integer, :even?, '() -> ``sing_or_type(trec, targs, :even?, "%bool")``'
|
174
|
+
RDL.type :Integer, :gcd, '(Integer) -> ``sing_or_type(trec, targs, :gcd, "Integer")``'
|
175
|
+
RDL.type :Integer, :gcdlcm, '(Integer) -> [Integer, Integer]'
|
176
|
+
RDL.type :Integer, :floor, '() -> ``sing_or_type(trec, targs, :floor, "Integer")``'
|
177
|
+
RDL.type :Integer, :imag, '() -> Integer r {{ r==0 }}' ## TODO
|
178
|
+
RDL.type :Integer, :imaginary, '() -> Integer r {{ r==0 }}' ## TODO
|
179
|
+
RDL.type :Integer, :integer?, '() -> true'
|
180
|
+
RDL.type :Integer, :lcm, '(Integer) -> ``sing_or_type(trec, targs, :lcm, "Integer")``'
|
181
|
+
RDL.type :Integer, :next, '() -> ``sing_or_type(trec, targs, :next, "Integer")``'
|
182
|
+
RDL.type :Integer, :numerator, '() -> ``sing_or_type(trec, targs, :numerator, "Integer")``'
|
183
|
+
RDL.type :Integer, :odd?, '() -> ``sing_or_type(trec, targs, :odd?, "%bool")``'
|
184
|
+
RDL.type :Integer, :ord, '() -> ``sing_or_type(trec, targs, :ord, "Integer")``'
|
185
|
+
RDL.type :Integer, :phase, '() -> ``sing_or_type(trec, targs, :phase, "%numeric")``'
|
186
|
+
RDL.type :Integer, :pred, '() -> ``sing_or_type(trec, targs, :pred, "Integer")``'
|
187
|
+
RDL.type :Integer, :rationalize, '() -> Rational' ## TODO
|
188
|
+
RDL.type :Integer, :rationalize, '(%numeric) -> Rational' ## TODO
|
189
|
+
RDL.type :Integer, :real, '() -> ``sing_or_type(trec, targs, :real, "Integer")``'
|
190
|
+
RDL.type :Integer, :real?, '() -> true'
|
191
|
+
RDL.type :Integer, :remainder, '(Integer x {{ x!=0 }}) -> Integer r {{ r>=0 }}' ## TODO
|
192
|
+
RDL.type :Integer, :remainder, '(Float x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :remainder, "Float")``'
|
193
|
+
RDL.type :Integer, :remainder, '(Rational x {{ x!=0 }}) -> Rational r {{ r>=0 }}' ## TODO
|
194
|
+
RDL.type :Integer, :remainder, '(BigDecimal x {{ x!=0 }}) -> ``sing_or_type(trec, targs, :gcd, "BigDecimal")``'
|
195
|
+
RDL.type :Integer, :round, '() -> ``sing_or_type(trec, targs, :round, "Integer")``'
|
196
|
+
RDL.type :Integer, :round, '(%numeric) -> ``sing_or_type(trec, targs, :round, "%numeric")``'
|
197
|
+
RDL.pre(:Integer, :round) { |x| x!=0 && if x.is_a?(Complex) then x.imaginary==0 && (if x.real.is_a?(Float)||x.real.is_a?(BigDecimal) then !x.real.infinite? && !x.real.nan? else true end) elsif x.is_a?(Float) then x!=Float::INFINITY && !x.nan? elsif x.is_a?(BigDecimal) then x!=BigDecimal::INFINITY && !x.nan? else true end} #Also, x must be in range [-2**31, 2**31].
|
198
|
+
RDL.type :Integer, :size, '() -> ``sing_or_type(trec, targs, :size, "Integer")``'
|
199
|
+
RDL.type :Integer, :succ, '() -> ``sing_or_type(trec, targs, :succ, "Integer")``'
|
200
|
+
RDL.type :Integer, :times, '() { (?Integer) -> %any } -> Integer'
|
201
|
+
RDL.type :Integer, :times, '() -> Enumerator<Integer>'
|
202
|
+
RDL.type :Integer, :to_c, '() -> Complex r {{ r.imaginary==0 }}'
|
203
|
+
RDL.type :Integer, :to_f, '() -> ``sing_or_type(trec, targs, :to_f, "Float")``'
|
204
|
+
RDL.type :Integer, :to_i, '() -> self'
|
205
|
+
RDL.type :Integer, :to_int, '() -> self'
|
206
|
+
RDL.type :Integer, :to_r, '() -> Rational' ## TODO
|
207
|
+
RDL.type :Integer, :truncate, '() -> ``sing_or_type(trec, targs, :truncate, "Integer")``'
|
208
|
+
RDL.type :Integer, :upto, '(Integer) { (Integer) -> %any } -> Integer'
|
209
|
+
RDL.type :Integer, :upto, '(Integer) -> Enumerator<Integer>'
|
210
|
+
RDL.type :Integer, :zero?, '() -> ``sing_or_type(trec, targs, :zero?, "%bool")``'
|
211
|
+
|
212
|
+
|
213
|
+
######### Non-dependent types below #########
|
214
|
+
|
215
|
+
|
3
216
|
RDL.type :Integer, :%, '(Integer x {{ x!=0 }}) -> Integer'
|
4
217
|
RDL.type :Integer, :%, '(Float x {{ x!=0 }}) -> Float'
|
5
218
|
RDL.type :Integer, :%, '(Rational x {{ x!=0 }}) -> Rational'
|
@@ -23,11 +236,11 @@ RDL.post(:Integer, :**) { |r,x| r.real?}
|
|
23
236
|
RDL.type :Integer, :**, '(Complex) -> Complex'
|
24
237
|
RDL.pre(:Integer, :**) { |x| x!=0 && if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end}
|
25
238
|
|
26
|
-
RDL.type :Integer, :+, '(Integer) -> Integer'
|
27
|
-
RDL.type :Integer, :+, '(Float) -> Float'
|
28
|
-
RDL.type :Integer, :+, '(Rational) -> Rational'
|
29
|
-
RDL.type :Integer, :+, '(BigDecimal) -> BigDecimal'
|
30
|
-
RDL.type :Integer, :+, '(Complex) -> Complex'
|
239
|
+
RDL.type :Integer, :+, '(Integer) -> Integer', effect: [:+, :+]
|
240
|
+
RDL.type :Integer, :+, '(Float) -> Float', effect: [:+, :+]
|
241
|
+
RDL.type :Integer, :+, '(Rational) -> Rational', effect: [:+, :+]
|
242
|
+
RDL.type :Integer, :+, '(BigDecimal) -> BigDecimal', effect: [:+, :+]
|
243
|
+
RDL.type :Integer, :+, '(Complex) -> Complex', effect: [:+, :+]
|
31
244
|
|
32
245
|
RDL.type :Integer, :-, '(Integer) -> Integer'
|
33
246
|
RDL.type :Integer, :-, '(Float) -> Float'
|
@@ -67,9 +280,9 @@ RDL.post(:Integer, :<=>) { |r,x| r == -1 || r == 0 || r == 1 }
|
|
67
280
|
RDL.type :Integer, :<=>, '(BigDecimal) -> Object'
|
68
281
|
RDL.post(:Integer, :<=>) { |r,x| r == -1 || r == 0 || r == 1 }
|
69
282
|
|
70
|
-
RDL.type :Integer, :==, '(Object) -> %bool'
|
283
|
+
RDL.type :Integer, :==, '(Object) -> %bool', effect: [:+, :+]
|
71
284
|
|
72
|
-
RDL.type :Integer, :===, '(Object) -> %bool'
|
285
|
+
RDL.type :Integer, :===, '(Object) -> %bool', effect: [:+, :+]
|
73
286
|
|
74
287
|
RDL.type :Integer, :>, '(Integer) -> %bool'
|
75
288
|
RDL.type :Integer, :>, '(Float) -> %bool'
|
@@ -154,7 +367,7 @@ RDL.type :Integer, :denominator, '() -> Integer'
|
|
154
367
|
RDL.post(:Integer, :denominator) { |r,x| r == 1 }
|
155
368
|
RDL.type :Integer, :downto, '(Integer) { (Integer) -> %any } -> Integer'
|
156
369
|
RDL.type :Integer, :downto, '(Integer limit) -> Enumerator<Integer>'
|
157
|
-
RDL.type :Integer, :even?, '() -> %bool'
|
370
|
+
RDL.type :Integer, :even?, '() -> %bool', effect: [:+ ,:+]
|
158
371
|
RDL.type :Integer, :gcd, '(Integer) -> Integer'
|
159
372
|
RDL.type :Integer, :gcdlcm, '(Integer) -> [Integer, Integer]'
|
160
373
|
RDL.type :Integer, :floor, '() -> Integer'
|
@@ -164,7 +377,7 @@ RDL.type :Integer, :integer?, '() -> true'
|
|
164
377
|
RDL.type :Integer, :lcm, '(Integer) -> Integer'
|
165
378
|
RDL.type :Integer, :next, '() -> Integer'
|
166
379
|
RDL.type :Integer, :numerator, '() -> Integer'
|
167
|
-
RDL.type :Integer, :odd?, '() -> %bool'
|
380
|
+
RDL.type :Integer, :odd?, '() -> %bool', effect: [:+, :+]
|
168
381
|
RDL.type :Integer, :ord, '() -> Integer'
|
169
382
|
RDL.type :Integer, :phase, '() -> %numeric'
|
170
383
|
RDL.type :Integer, :pred, '() -> Integer'
|
@@ -181,7 +394,7 @@ RDL.type :Integer, :round, '(%numeric) -> %numeric'
|
|
181
394
|
RDL.pre(:Integer, :round) { |x| x!=0 && if x.is_a?(Complex) then x.imaginary==0 && (if x.real.is_a?(Float)||x.real.is_a?(BigDecimal) then !x.real.infinite? && !x.real.nan? else true end) elsif x.is_a?(Float) then x!=Float::INFINITY && !x.nan? elsif x.is_a?(BigDecimal) then x!=BigDecimal::INFINITY && !x.nan? else true end} #Also, x must be in range [-2**31, 2**31].
|
182
395
|
RDL.type :Integer, :size, '() -> Integer'
|
183
396
|
RDL.type :Integer, :succ, '() -> Integer'
|
184
|
-
RDL.type :Integer, :times, '() { (Integer) -> %any } -> Integer'
|
397
|
+
RDL.type :Integer, :times, '() { (?Integer) -> %any } -> Integer'
|
185
398
|
RDL.type :Integer, :times, '() -> Enumerator<Integer>'
|
186
399
|
RDL.type :Integer, :to_c, '() -> Complex r {{ r.imaginary==0 }}'
|
187
400
|
RDL.type :Integer, :to_f, '() -> Float'
|
data/lib/types/core/io.rb
CHANGED
@@ -62,7 +62,7 @@ RDL.type :IO, :ioctl, '(Integer integer_cmd, String or Integer arg) -> Integer'
|
|
62
62
|
RDL.type :IO, :isatty, '() -> %bool'
|
63
63
|
RDL.type :IO, :lineno, '() -> Integer'
|
64
64
|
RDL.type :IO, :lineno=, '(Integer) -> Integer'
|
65
|
-
RDL.rdl_alias :IO, :lines, :
|
65
|
+
RDL.rdl_alias :IO, :lines, :each # deprecated
|
66
66
|
RDL.type :IO, :pid, '() -> Integer'
|
67
67
|
RDL.type :IO, :pos, '() -> Integer'
|
68
68
|
RDL.type :IO, :pos=, '(Integer) -> Integer'
|
@@ -81,7 +81,7 @@ RDL.type :IO, :readpartial, '(Integer maxlen) -> String'
|
|
81
81
|
RDL.type :IO, :readpartial, '(Integer maxlen, String outbuf) -> String outbuf'
|
82
82
|
RDL.type :IO, :reopen, '(IO other_IO) -> IO'
|
83
83
|
RDL.type :IO, :reopen, '(String path, String mode_str) -> IO'
|
84
|
-
RDL.type :IO, :
|
84
|
+
RDL.type :IO, :rewind, '() -> 0'
|
85
85
|
RDL.type :IO, :seek, '(Integer amount, ?Integer whence) -> 0'
|
86
86
|
RDL.type :IO, :set_encoding, '(?String or Encoding ext_or_ext_int_enc) -> self'
|
87
87
|
RDL.type :IO, :set_encoding, '(?String or Encoding ext_enc, ?String or Encoding int_enc) -> self'
|
data/lib/types/core/kernel.rb
CHANGED
@@ -2,6 +2,7 @@ RDL.nowrap :Kernel
|
|
2
2
|
|
3
3
|
# RDL.type :Kernel, 'self.Array', '([to_ary: () -> Array<t>]) -> Array<t>'
|
4
4
|
# RDL.type :Kernel, 'self.Array', '([to_a: () -> Array<t>]) -> Array<t>'
|
5
|
+
RDL.type :Kernel, 'self.===', "(%any) -> %bool"
|
5
6
|
RDL.type :Kernel, 'self.Complex', '(Numeric x, Numeric y) -> Complex'
|
6
7
|
RDL.type :Kernel, 'self.Complex', '(String x) -> Complex'
|
7
8
|
RDL.type :Kernel, 'self.Float', '(Numeric x) -> Float'
|
@@ -57,8 +58,9 @@ RDL.type :Kernel, 'self.open', '(String path, ?(String or Integer) mode, ?String
|
|
57
58
|
RDL.type :Kernel, 'self.printf', '(?IO, ?String, *%any) -> nil'
|
58
59
|
RDL.type :Kernel, :proc, '() {(*%any) -> %any} -> Proc' # TODO more precise
|
59
60
|
RDL.type :Kernel, 'self.putc', '(Integer) -> Integer'
|
60
|
-
RDL.type :Kernel, 'self.puts', '(*[to_s : () -> String]) -> nil'
|
61
|
-
RDL.type :Kernel, 'self.raise', '() -> %bot'
|
61
|
+
RDL.type :Kernel, 'self.puts', '(*[to_s : () -> String]) -> nil', effect: [:-,:+]
|
62
|
+
RDL.type :Kernel, 'self.raise', '() -> %bot', effect: [:+, :+]
|
63
|
+
RDL.type :Kernel, 'raise', '() -> %bot', effect: [:+, :+]
|
62
64
|
# RDL.type :Kernel, 'self.raise', '(String or [exception : () -> String], ?String, ?Array<String>) -> %any'
|
63
65
|
# TODO: above same as fail?
|
64
66
|
RDL.type :Kernel, 'self.rand', '(Integer or Range max) -> Numeric'
|
@@ -71,7 +73,7 @@ RDL.type :Kernel, 'self.select',
|
|
71
73
|
# RDL.type :Kernel, 'self.set_trace_func' #TODO
|
72
74
|
RDL.type :Kernel, 'self.sleep', '(Numeric duration) -> Integer'
|
73
75
|
# RDL.type :Kernel, 'self.spawn' #TODO
|
74
|
-
RDL.rdl_alias :Kernel, :sprintf, :format # TODO: are they aliases?
|
76
|
+
RDL.rdl_alias :Kernel, :'self.sprintf', :'self.format' # TODO: are they aliases?
|
75
77
|
RDL.type :Kernel, 'self.srand', '(Numeric number) -> Numeric'
|
76
78
|
RDL.type :Kernel, 'self.syscall', '(Integer num, *%any args) -> %any' # TODO : ?
|
77
79
|
# RDL.type :Kernel, 'self.system' # TODO
|
@@ -81,9 +83,10 @@ RDL.type :Kernel, 'self.test', '(String cmd, String file1, ?String file2) -> %bo
|
|
81
83
|
# RDL.type :Kernel, 'self.trap' # TODO
|
82
84
|
# RDL.type :Kernel, 'self.untrace_var' # TODO
|
83
85
|
RDL.type :Kernel, 'self.warn', '(*String msg) -> nil'
|
84
|
-
RDL.type :Kernel, :clone, '() -> self'
|
86
|
+
RDL.type :Kernel, :clone, '() -> self', effect: [:~, :+]
|
85
87
|
RDL.type :Kernel, :raise, '() -> %bot'
|
86
88
|
RDL.type :Kernel, :raise, '(String) -> %bot'
|
87
|
-
RDL.type :Kernel, :raise, '(Class, String, Array<String>) -> %bot'
|
89
|
+
RDL.type :Kernel, :raise, '(Class, ?String, ?Array<String>) -> %bot'
|
90
|
+
RDL.type :Kernel, :raise, '(Exception, ?String, ?Array<String>) -> %bot'
|
88
91
|
RDL.type :Kernel, :send, '(String or Symbol, *%any) -> %any'
|
89
92
|
RDL.type :Kernel, :send, '(String or Symbol, *%any) { (*%any) -> %any } -> %any'
|
data/lib/types/core/marshal.rb
CHANGED
data/lib/types/core/module.rb
CHANGED
@@ -9,8 +9,8 @@ RDL.type :Module, :<, '(Module other) -> %bool or nil'
|
|
9
9
|
RDL.type :Module, :<=, '(Module other) -> %bool or nil'
|
10
10
|
RDL.type :Module, :<=>, '(Module other) -> -1 or 0 or 1 or nil'
|
11
11
|
RDL.type :Module, :==, '(%any other) -> %bool'
|
12
|
-
RDL.type :Module, :equal
|
13
|
-
RDL.type :Module, :eql
|
12
|
+
RDL.type :Module, :equal?, '(%any other) -> %bool'
|
13
|
+
RDL.type :Module, :eql?, '(%any other) -> %bool'
|
14
14
|
RDL.type :Module, :===, '(%any other) -> %bool'
|
15
15
|
RDL.type :Module, :>, '(Module other) -> %bool or nil'
|
16
16
|
RDL.type :Module, :>=, '(Module other) -> %bool or nil'
|
@@ -53,7 +53,7 @@ RDL.type :Module, :public_instance_methods, '(?%bool include_super) -> Array<Sym
|
|
53
53
|
RDL.type :Module, :public_method_defined?, '(Symbol or String) -> %bool'
|
54
54
|
RDL.type :Module, :remove_class_variable, '(Symbol) -> %any'
|
55
55
|
RDL.type :Module, :singleton_class?, '() -> %bool'
|
56
|
-
RDL.type :Module, :to_s, '() -> String'
|
56
|
+
RDL.type :Module, :to_s, '() -> String', effect: [:+, :+]
|
57
57
|
# private methods below here
|
58
58
|
RDL.type :Module, :alias_method, '(Symbol new_name, Symbol old_name) -> self'
|
59
59
|
RDL.type :Module, :append_features, '(Module) -> self'
|
data/lib/types/core/numeric.rb
CHANGED
@@ -2,8 +2,6 @@ RDL.nowrap :Numeric
|
|
2
2
|
|
3
3
|
RDL.type :Numeric, :%, '(%numeric) -> %numeric'
|
4
4
|
RDL.pre(:Numeric, :%) { |x| x!=0}
|
5
|
-
RDL.type :Numeric, :+, '(%numeric) -> %numeric'
|
6
|
-
RDL.type :Numeric, :-, '() -> %numeric'
|
7
5
|
RDL.type :Numeric, :-@, '() -> %numeric'
|
8
6
|
RDL.type :Numeric, :+@, '() -> %numeric'
|
9
7
|
RDL.type :Numeric, :<=>, '(%numeric) -> Object'
|
data/lib/types/core/object.rb
CHANGED
@@ -24,10 +24,10 @@
|
|
24
24
|
|
25
25
|
RDL.type :Object, :!~, '(%any other) -> %bool', wrap: false
|
26
26
|
RDL.type :Object, :<=>, '(%any other) -> Integer or nil', wrap: false
|
27
|
-
RDL.type :Object, :===, '(%any other) -> %bool', wrap: false
|
27
|
+
RDL.type :Object, :===, '(%any other) -> %bool', wrap: false, effect: [:+, :+]
|
28
28
|
RDL.type :Object, :=~, '(%any other) -> nil', wrap: false
|
29
29
|
RDL.type :Object, :class, '() -> Class', wrap: false
|
30
|
-
RDL.type :Object, :clone, '() -> self', wrap: false
|
30
|
+
RDL.type :Object, :clone, '() -> self', wrap: false, effect: [:+, :+]
|
31
31
|
# RDL.type :Object, :define_singleton_method, '(XXXX : *XXXX)') # TODO
|
32
32
|
RDL.type :Object, :display, '(IO port) -> nil', wrap: false
|
33
33
|
RDL.type :Object, :dup, '() -> self an_object', wrap: false
|
@@ -44,11 +44,11 @@ RDL.type :Object, :instance_variable_defined?, '(Symbol or String) -> %bool', wr
|
|
44
44
|
RDL.type :Object, :instance_variable_get, '(Symbol or String) -> %any', wrap: false
|
45
45
|
RDL.type :Object, :instance_variable_set, '(Symbol or String, %any) -> %any', wrap: false # returns 2nd argument
|
46
46
|
RDL.type :Object, :instance_variables, '() -> Array<Symbol>', wrap: false
|
47
|
-
RDL.type :Object, :is_a?, '(Class or Module) -> %bool', wrap: false
|
47
|
+
RDL.type :Object, :is_a?, '(Class or Module) -> %bool', wrap: false, effect: [:+, :+]
|
48
48
|
RDL.type :Object, :kind_of?, '(Class) -> %bool', wrap: false
|
49
49
|
RDL.type :Object, :method, '(Symbol) -> Method', wrap: false
|
50
50
|
RDL.type :Object, :methods, '(?%bool regular) -> Array<Symbol>', wrap: false
|
51
|
-
RDL.type :Object, :nil?, '() -> %bool', wrap: false
|
51
|
+
RDL.type :Object, :nil?, '() -> %bool', wrap: false, effect: [:+, :+]
|
52
52
|
RDL.type :Object, :private_methods, '(?%bool all) -> Array<Symbol>', wrap: false
|
53
53
|
RDL.type :Object, :protected_methods, '(?%bool all) -> Array<Symbol>', wrap: false
|
54
54
|
RDL.type :Object, :public_method, '(Symbol) -> Method', wrap: false
|
@@ -56,7 +56,7 @@ RDL.type :Object, :public_methods, '(?%bool all) -> Array<Symbol>', wrap: false
|
|
56
56
|
RDL.type :Object, :public_send, '(Symbol or String, *%any args) -> %any', wrap: false
|
57
57
|
RDL.type :Object, :remove_instance_variable, '(Symbol) -> %any', wrap: false
|
58
58
|
# RDL.type :Object, :respond_to?, '(Symbol or String, ?%bool include_all) -> %bool'
|
59
|
-
RDL.type :Object, :send, '(Symbol or String, *%any
|
59
|
+
RDL.type :Object, :send, '(Symbol or String, *%any) -> %any', wrap: false, effect: [:-, :+] # Can't wrap this, used outside wrap switch
|
60
60
|
RDL.type :Object, :singleton_class, '() -> Class', wrap: false
|
61
61
|
RDL.type :Object, :singleton_method, '(Symbol) -> Method', wrap: false
|
62
62
|
RDL.type :Object, :singleton_methods, '(?%bool all) -> Array<Symbol>', wrap: false
|
data/lib/types/core/pathname.rb
CHANGED
@@ -52,7 +52,7 @@ RDL.type :Pathname, :lchmod, '(Integer mode) -> Integer'
|
|
52
52
|
RDL.type :Pathname, :lchown, '(Integer owner, Integer group) -> Integer'
|
53
53
|
RDL.type :Pathname, :lstat, '() -> File::Stat'
|
54
54
|
RDL.type :Pathname, :make_link, '(String old) -> 0'
|
55
|
-
RDL.type :Pathname, :symlink
|
55
|
+
RDL.type :Pathname, :symlink?, '(String old) -> 0'
|
56
56
|
RDL.type :Pathname, :mkdir, '(String p1) -> 0'
|
57
57
|
RDL.type :Pathname, :mkpath, '() -> %any' # TODO return?
|
58
58
|
RDL.type :Pathname, :mountpoint?, '() -> %bool'
|
@@ -66,7 +66,7 @@ RDL.type :Pathname, :parent, '() -> Pathname'
|
|
66
66
|
RDL.type :Pathname, :pipe?, '() -> %bool'
|
67
67
|
RDL.type :Pathname, :read, '(?Integer length, ?Integer offset, ?Integer open_args) -> String'
|
68
68
|
RDL.type :Pathname, :readable?, '() -> %bool'
|
69
|
-
RDL.type :Pathname, :readable_real
|
69
|
+
RDL.type :Pathname, :readable_real?, '() -> %bool'
|
70
70
|
RDL.type :Pathname, :readlines, '(?String sep, ?Integer limit, ?Integer open_args) -> Array<String>'
|
71
71
|
RDL.type :Pathname, :readlink, '() -> String file'
|
72
72
|
RDL.type :Pathname, :realdirpath, '(?String p1) -> String'
|
data/lib/types/core/process.rb
CHANGED
@@ -30,10 +30,10 @@ RDL.type :Process, 'self.maxgroups', '() -> Integer'
|
|
30
30
|
RDL.type :Process, 'self.maxgroups=', '(Integer) -> Integer'
|
31
31
|
RDL.type :Process, 'self.pid', '() -> Integer'
|
32
32
|
RDL.type :Process, 'self.ppid', '() -> Integer'
|
33
|
-
RDL.type :Process, 'self.pgid', '(Integer pid, Integer) -> Integer'
|
34
33
|
RDL.type :Process, 'self.setpriority', '(Integer kind, Integer, Integer priority) -> 0'
|
35
34
|
RDL.type :Process, 'self.setproctitle', '(String) -> String'
|
36
35
|
RDL.type :Process, 'self.setrlimit', '(Symbol or String or Integer resource, Integer cur_limit, ?Integer max_limit) -> nil'
|
36
|
+
RDL.type :Process, 'self.setpgid', '(Integer pid, Integer) -> Integer'
|
37
37
|
RDL.type :Process, 'self.setsid', '() -> Integer'
|
38
38
|
#RDL.type :Process, 'self.spawn', '(?Hash<String, String> env, String command, *String args) -> %any' # TODO: env
|
39
39
|
RDL.type :Process, 'self.times', '() -> Process::Tms'
|
@@ -86,11 +86,9 @@ RDL.nowrap :'Process::Status'
|
|
86
86
|
RDL.type :'Process::Status', :success?, '() -> %bool'
|
87
87
|
RDL.type :'Process::Status', :termsig, '() -> Integer or nil'
|
88
88
|
RDL.type :'Process::Status', :to_i, '() -> Integer'
|
89
|
-
RDL.rdl_alias :'Process::Status', :to_int, :to_i
|
90
89
|
RDL.type :'Process::Status', :to_s, '() -> String'
|
91
90
|
|
92
91
|
RDL.nowrap :'Process::Sys'
|
93
|
-
RDL.type :'Process::Sys', 'self.geteid', '() -> Integer'
|
94
92
|
RDL.type :'Process::Sys', 'self.geteuid', '() -> Integer'
|
95
93
|
RDL.type :'Process::Sys', 'self.getgid', '() -> Integer'
|
96
94
|
RDL.type :'Process::Sys', 'self.getuid', '() -> Integer'
|
data/lib/types/core/range.rb
CHANGED
@@ -26,7 +26,7 @@ RDL.type :Range, :max, '() -> t'
|
|
26
26
|
RDL.type :Range, :max, '() { (t, t) -> Integer } -> t'
|
27
27
|
RDL.type :Range, :max, '(Integer n) -> Array<t>'
|
28
28
|
RDL.type :Range, :max, '(Integer n) { (t, t) -> Integer } -> Array<t>'
|
29
|
-
RDL.rdl_alias :Range, :member?, :include
|
29
|
+
RDL.rdl_alias :Range, :member?, :include?
|
30
30
|
RDL.type :Range, :min, '() -> t'
|
31
31
|
RDL.type :Range, :min, '() { (t, t) -> Integer } -> t'
|
32
32
|
RDL.type :Range, :min, '(Integer n) -> Array<t>'
|