typeprof 0.14.0 → 0.15.2

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.
data/smoke/ivar3.rb CHANGED
@@ -13,5 +13,5 @@ smoke/ivar3.rb:3: [warning] inconsistent assignment to RBS-declared variable
13
13
  class Foo
14
14
  @bar: String
15
15
 
16
- def initialize: -> String
16
+ def initialize: -> void
17
17
  end
data/smoke/kwrest.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  class Foo
2
2
  def foo(**r)
3
- @r = r[42]
3
+ @r = r["foo".to_sym][42]
4
4
  end
5
5
  end
6
6
 
@@ -9,5 +9,5 @@ __END__
9
9
  class Foo
10
10
  @r: Integer
11
11
 
12
- # def foo: (**Hash[Integer, Integer]) -> void
12
+ # def foo: (**Integer) -> void
13
13
  end
data/smoke/kwrest.rbs CHANGED
@@ -1,3 +1,3 @@
1
1
  class Foo
2
- def foo: (**Hash[Integer, Integer]) -> void
2
+ def foo: (**Integer) -> void
3
3
  end
@@ -24,6 +24,6 @@ end
24
24
  class C
25
25
  @target: D
26
26
 
27
- def initialize: (D x) -> D
27
+ def initialize: (D x) -> void
28
28
  def method_missing: (:foo m, *:X | :Y | :Z args) -> nil
29
29
  end
data/smoke/next2.rb CHANGED
@@ -13,5 +13,5 @@ __END__
13
13
  # Classes
14
14
  class Object
15
15
  private
16
- def foo: { -> (Integer | String) } -> (Integer | String)
16
+ def foo: { -> Integer } -> Integer
17
17
  end
data/smoke/noname.rb ADDED
@@ -0,0 +1,9 @@
1
+ def foo(*)
2
+ end
3
+
4
+ __END__
5
+ # Classes
6
+ class Object
7
+ private
8
+ def foo: (*untyped noname_2) -> nil
9
+ end
data/smoke/or_raise.rb ADDED
@@ -0,0 +1,18 @@
1
+ def foo
2
+ if rand < 0.5
3
+ 1
4
+ end
5
+ end
6
+
7
+ def bar
8
+ x = foo or raise("nil")
9
+ x.times { }
10
+ end
11
+
12
+ __END__
13
+ # Classes
14
+ class Object
15
+ private
16
+ def foo: -> Integer?
17
+ def bar: -> Integer
18
+ end
@@ -1,4 +1,5 @@
1
1
  # RUBY_VERSION >= 3.0
2
+ # NO_SHOW_ERRORS
2
3
 
3
4
  def foo
4
5
  case [:a, :b, :c]
@@ -11,12 +12,6 @@ end
11
12
  foo
12
13
 
13
14
  __END__
14
- # Errors
15
- smoke/pattern-match1.rb:5: [error] undefined method: nil#length
16
- smoke/pattern-match1.rb:5: [error] undefined method: nil#[]
17
- smoke/pattern-match1.rb:5: [error] undefined method: nil#[]
18
- smoke/pattern-match1.rb:5: [error] undefined method: nil#[]
19
-
20
15
  # Classes
21
16
  class Object
22
17
  private
data/smoke/proc6.rb ADDED
@@ -0,0 +1,13 @@
1
+ # a test for a recursive proc that receives (or returns) itself
2
+ def foo
3
+ f = -> x { x }
4
+ f[f]
5
+ f
6
+ end
7
+
8
+ __END__
9
+ # Classes
10
+ class Object
11
+ private
12
+ def foo: -> ^(untyped) -> untyped
13
+ end
data/smoke/proc7.rb ADDED
@@ -0,0 +1,32 @@
1
+ class Foo
2
+ def id(&blk)
3
+ blk
4
+ end
5
+
6
+ def check(v)
7
+ rand < 0.5 ? v : [v]
8
+ end
9
+
10
+ def foo
11
+ check(id {}).call # cause "undefined method: [^-> nil?]#call"
12
+ end
13
+
14
+ def foo1
15
+ id { }
16
+ end
17
+ end
18
+
19
+ __END__
20
+ # Errors
21
+ smoke/proc7.rb:11: [error] undefined method: nil#call
22
+ smoke/proc7.rb:11: [error] undefined method: [(^(unknown) -> bot | untyped)?]#call
23
+ smoke/proc7.rb:11: [error] undefined method: nil#call
24
+ smoke/proc7.rb:11: [error] undefined method: [(^-> nil | untyped)?]#call
25
+
26
+ # Classes
27
+ class Foo
28
+ def id: ?{ -> nil } -> ^-> nil?
29
+ def check: ((^-> nil | untyped)? v) -> (([(^-> nil | untyped)?] | ^-> nil | untyped)?)
30
+ def foo: -> untyped?
31
+ def foo1: -> ^-> nil?
32
+ end
data/smoke/rbs-tyvar4.rb CHANGED
@@ -32,6 +32,6 @@ __END__
32
32
  class Foo
33
33
  @ivar: Array[Array[String]]
34
34
 
35
- def initialize: (Array[Array[String]] ivar) -> Array[Array[String]]
35
+ def initialize: (Array[Array[String]] ivar) -> void
36
36
  def foo: (:a | :b n) -> nil
37
37
  end
data/smoke/rbs-vars.rb CHANGED
@@ -21,9 +21,6 @@ class Foo
21
21
  end
22
22
 
23
23
  __END__
24
- # Global variables
25
- #$gvar: :gvar_example
26
-
27
24
  # Classes
28
25
  class Object
29
26
  private
data/smoke/require1.rb ADDED
@@ -0,0 +1,13 @@
1
+ require_relative "require2"
2
+
3
+ class Foo
4
+ def foo
5
+ end
6
+ end
7
+
8
+ __END__
9
+ # Classes
10
+ class Foo
11
+ def bar: -> nil
12
+ def foo: -> nil
13
+ end
data/smoke/require2.rb ADDED
@@ -0,0 +1,13 @@
1
+ require_relative "require1"
2
+
3
+ class Foo
4
+ def bar
5
+ end
6
+ end
7
+
8
+ __END__
9
+ # Classes
10
+ class Foo
11
+ def foo: -> nil
12
+ def bar: -> nil
13
+ end
data/smoke/struct5.rb CHANGED
@@ -12,5 +12,5 @@ __END__
12
12
  # Classes
13
13
  class Foo < Struct[untyped]
14
14
  attr_accessor foo(): String
15
- def initialize: (Integer foo) -> Foo
15
+ def initialize: (Integer foo) -> void
16
16
  end
data/smoke/struct6.rb CHANGED
@@ -11,5 +11,5 @@ class AnonymousStruct_generated_1 < Struct[untyped]
11
11
  end
12
12
 
13
13
  class Foo < AnonymousStruct_generated_1
14
- def initialize: (untyped foo) -> Foo
14
+ def initialize: (untyped foo) -> void
15
15
  end
data/smoke/struct7.rb CHANGED
@@ -13,5 +13,5 @@ end
13
13
  __END__
14
14
  # Classes
15
15
  class Foo < Struct[untyped]
16
- def initialize: -> Foo
16
+ def initialize: -> void
17
17
  end
data/smoke/super3.rb CHANGED
@@ -16,5 +16,5 @@ class Foo
16
16
  @a: Integer
17
17
 
18
18
  def self.new: (Integer a) -> Foo
19
- def initialize: (Integer a) -> Integer
19
+ def initialize: (Integer a) -> void
20
20
  end
@@ -18,5 +18,5 @@ end
18
18
 
19
19
  class Foo
20
20
  attr_reader foo: Integer | untyped
21
- def initialize: (Integer | untyped foo) -> (Integer | untyped)
21
+ def initialize: (Integer | untyped foo) -> void
22
22
  end
@@ -11,5 +11,5 @@ __END__
11
11
  # Classes
12
12
  class Foo
13
13
  attr_reader foo: [Integer]
14
- def initialize: -> [Integer]
14
+ def initialize: -> void
15
15
  end
data/testbed/ao.rb CHANGED
@@ -291,7 +291,7 @@ end
291
291
 
292
292
  top
293
293
 
294
- if _dummy = false
294
+ if $0 == __FILE__
295
295
  v = Vec.new(0.0, 0.0, 0.0)
296
296
  v.vadd(v)
297
297
  end
data/typeprof.gemspec CHANGED
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_runtime_dependency "rbs", ">= 1.0.0"
33
+ spec.add_runtime_dependency "rbs", ">= 1.3.1"
34
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typeprof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke Endoh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-18 00:00:00.000000000 Z
11
+ date: 2021-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbs
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0
19
+ version: 1.3.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0
26
+ version: 1.3.1
27
27
  description: |
28
28
  TypeProf performs a type analysis of non-annotated Ruby code.
29
29
 
@@ -216,6 +216,8 @@ files:
216
216
  - smoke/hash3.rb
217
217
  - smoke/hash4.rb
218
218
  - smoke/hash5.rb
219
+ - smoke/huge_union.rb
220
+ - smoke/identifier_keywords.rb
219
221
  - smoke/included.rb
220
222
  - smoke/inheritance.rb
221
223
  - smoke/inheritance2.rb
@@ -267,6 +269,7 @@ files:
267
269
  - smoke/multiple-superclass.rb
268
270
  - smoke/next1.rb
269
271
  - smoke/next2.rb
272
+ - smoke/noname.rb
270
273
  - smoke/object-send1.rb
271
274
  - smoke/object-send2.rb
272
275
  - smoke/object-send3.rb
@@ -274,6 +277,7 @@ files:
274
277
  - smoke/optional1.rb
275
278
  - smoke/optional2.rb
276
279
  - smoke/optional3.rb
280
+ - smoke/or_raise.rb
277
281
  - smoke/parameterizedd-self.rb
278
282
  - smoke/parameterizedd-self2.rb
279
283
  - smoke/pathname1.rb
@@ -290,6 +294,8 @@ files:
290
294
  - smoke/proc3.rb
291
295
  - smoke/proc4.rb
292
296
  - smoke/proc5.rb
297
+ - smoke/proc6.rb
298
+ - smoke/proc7.rb
293
299
  - smoke/public.rb
294
300
  - smoke/range.rb
295
301
  - smoke/rbs-alias.rb
@@ -332,6 +338,8 @@ files:
332
338
  - smoke/redo1.rb
333
339
  - smoke/redo2.rb
334
340
  - smoke/req-keyword.rb
341
+ - smoke/require1.rb
342
+ - smoke/require2.rb
335
343
  - smoke/rescue1.rb
336
344
  - smoke/rescue2.rb
337
345
  - smoke/rescue3.rb