rdl 2.0.0.rc2 → 2.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +7 -1
- data/README.md +94 -20
- data/lib/rdl.rb +4 -1
- data/lib/rdl/config.rb +90 -3
- data/lib/rdl/info.rb +16 -0
- data/lib/rdl/typecheck.rb +207 -79
- data/lib/rdl/types/bot.rb +1 -1
- data/lib/rdl/types/dependent_arg.rb +17 -8
- data/lib/rdl/types/{finitehash.rb → finite_hash.rb} +3 -29
- data/lib/rdl/types/generic.rb +1 -37
- data/lib/rdl/types/intersection.rb +1 -0
- data/lib/rdl/types/lexer.rex +2 -1
- data/lib/rdl/types/lexer.rex.rb +4 -1
- data/lib/rdl/types/method.rb +2 -12
- data/lib/rdl/types/nominal.rb +1 -22
- data/lib/rdl/types/non_null.rb +50 -0
- data/lib/rdl/types/parser.racc +3 -1
- data/lib/rdl/types/parser.tab.rb +222 -190
- data/lib/rdl/types/singleton.rb +1 -6
- data/lib/rdl/types/structural.rb +1 -10
- data/lib/rdl/types/top.rb +1 -2
- data/lib/rdl/types/tuple.rb +3 -19
- data/lib/rdl/types/type.rb +223 -0
- data/lib/rdl/types/union.rb +12 -2
- data/lib/rdl/types/var.rb +4 -1
- data/lib/rdl/types/wild_query.rb +1 -0
- data/lib/rdl/wrap.rb +199 -169
- data/lib/rdl_disable.rb +41 -0
- data/lib/rdl_types.rb +1 -4
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/_aliases.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/abbrev.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/array.rb +56 -56
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/base64.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/basic_object.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/benchmark.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/bigdecimal.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/bigmath.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/bignum.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/class.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/complex.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/coverage.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/csv.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/date.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/dir.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/encoding.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/enumerable.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/enumerator.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/exception.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/file.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/fileutils.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/fixnum.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/float.rb +26 -26
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/gem.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/hash.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/integer.rb +8 -8
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/io.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/kernel.rb +12 -11
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/marshal.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/matchdata.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/math.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/module.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/nil.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/numeric.rb +0 -0
- data/lib/types/core-ruby-2.x/object.rb +75 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/pathname.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/process.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/random.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/range.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/rational.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/regexp.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/set.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/string.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/strscan.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/symbol.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/time.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/uri.rb +0 -0
- data/{types/ruby-2.x → lib/types/core-ruby-2.x}/yaml.rb +0 -0
- data/lib/types/core.rb +4 -0
- data/rdl.gemspec +2 -2
- data/test/test_le.rb +77 -35
- data/test/test_parser.rb +75 -59
- data/test/test_rdl.rb +18 -0
- data/test/test_typecheck.rb +73 -4
- metadata +54 -57
- data/lib/rails_types.rb +0 -1
- data/types/rails-4.2.1/fixnum.rb +0 -3
- data/types/rails-4.2.1/string.rb +0 -3
- data/types/rails-tmp/action_dispatch.rb +0 -406
- data/types/rails-tmp/active_record.rb +0 -406
- data/types/rails-tmp/devise_contracts.rb +0 -216
- data/types/ruby-2.x/object.rb +0 -73
data/types/ruby-2.x/object.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
class Object
|
2
|
-
rdl_nowrap
|
3
|
-
|
4
|
-
# type :ARGF, ARGF
|
5
|
-
# type :ARGV, 'Array<String>'
|
6
|
-
# type :DATA, 'File'
|
7
|
-
# type :ENV, ENV
|
8
|
-
# type :FALSE, '%false'
|
9
|
-
# type :NIL, 'nil'
|
10
|
-
# type :RUBY_COPYRIGHT, 'String'
|
11
|
-
# type :RUBY_DESCRIPTION, 'String'
|
12
|
-
# type :RUBY_ENGINE, 'String'
|
13
|
-
# type :RUBY_PATCHLEVEL, Fixnum
|
14
|
-
# type :RUBY_PLATFORM, 'String'
|
15
|
-
# type :RUBY_RELEASE_DATE, 'String'
|
16
|
-
# type :RUBY_REVISION, Fixnum
|
17
|
-
# type :RUBY_VERSION, 'String'
|
18
|
-
# type :STDERR, 'IO'
|
19
|
-
# type :STDIN, 'IO'
|
20
|
-
# type :STDOUT, 'IO'
|
21
|
-
# type :TOPLEVEL_BINDING, 'Binding'
|
22
|
-
# type :TRUE, '%true'
|
23
|
-
|
24
|
-
type :!~, '(%any other) -> %bool'
|
25
|
-
type :<=>, '(%any other) -> Fixnum or nil'
|
26
|
-
type :===, '(%any other) -> %bool'
|
27
|
-
type :=~, '(%any other) -> nil'
|
28
|
-
type :class, '() -> Class'
|
29
|
-
type :clone, '() -> self'
|
30
|
-
# type :define_singleton_method, '(XXXX : *XXXX)') # TODO
|
31
|
-
type :display, '(IO port) -> nil'
|
32
|
-
type :dup, '() -> self an_object'
|
33
|
-
type :enum_for, '(?Symbol method, *%any args) -> Enumerator<%any>'
|
34
|
-
type :enum_for, '(?Symbol method, *%any args) { (*%any args) -> %any } -> Enumerator<%any>'
|
35
|
-
type :eql?, '(%any other) -> %bool'
|
36
|
-
# type :extend, '(XXXX : *XXXX)') # TODO
|
37
|
-
type :freeze, '() -> self'
|
38
|
-
type :frozen?, '() -> %bool'
|
39
|
-
type :hash, '() -> Fixnum'
|
40
|
-
type :inspect, '() -> String'
|
41
|
-
type :instance_of?, '(Class) -> %bool'
|
42
|
-
type :instance_variable_defined?, '(Symbol or String) -> %bool'
|
43
|
-
type :instance_variable_get, '(Symbol or String) -> %any'
|
44
|
-
type :instance_variable_set, '(Symbol or String, %any) -> %any' # returns 2nd argument
|
45
|
-
type :instance_variables, '() -> Array<Symbol>'
|
46
|
-
type :is_a?, '(Class or Module) -> %bool'
|
47
|
-
type :kind_of?, '(Class) -> %bool'
|
48
|
-
type :method, '(Symbol) -> Method'
|
49
|
-
type :methods, '(?%bool regular) -> Array<Symbol>'
|
50
|
-
type :nil?, '() -> %bool'
|
51
|
-
type :private_methods, '(?%bool all) -> Array<Symbol>'
|
52
|
-
type :protected_methods, '(?%bool all) -> Array<Symbol>'
|
53
|
-
type :public_method, '(Symbol) -> Method'
|
54
|
-
type :public_methods, '(?%bool all) -> Array<Symbol>'
|
55
|
-
type :public_send, '(Symbol or String, *%any args) -> %any'
|
56
|
-
type :remove_instance_variable, '(Symbol) -> %any'
|
57
|
-
# type :respond_to?, '(Symbol or String, ?%bool include_all) -> %bool'
|
58
|
-
type :send, '(Symbol or String, *%any args) -> %any', wrap: false # Can't wrap this, used outside wrap switch
|
59
|
-
type :singleton_class, '() -> Class'
|
60
|
-
type :singleton_method, '(Symbol) -> Method'
|
61
|
-
type :singleton_methods, '(?%bool all) -> Array<Symbol>'
|
62
|
-
type :taint, '() -> self'
|
63
|
-
type :tainted?, '() -> %bool'
|
64
|
-
# type :tap, '()') # TODO
|
65
|
-
type :to_enum, '(?Symbol method, *%any args) -> Enumerator<%any>'
|
66
|
-
type :to_enum, '(?Symbol method, *%any args) {(*%any args) -> %any} -> Enumerator<%any>'
|
67
|
-
# TODO: above alias for enum_for?
|
68
|
-
type :to_s, '() -> String'
|
69
|
-
type :trust, '() -> self'
|
70
|
-
type :untaint, '() -> self'
|
71
|
-
type :untrust, '() -> self'
|
72
|
-
type :untrusted?, '() -> %bool'
|
73
|
-
end
|