1. 型シグネチャフォーマット
•Rubyコードの型情報を示すもの
class Array[A]
includeEnumerable
def []: (Integer) -> A
def []=: (Integer,A) -> A
def each:
{ (A) -> void } -> self
...
end
interface
generics
union type
option type
any type
Proposal:
ruby-signature
7
RubyKaigi からの進捗 (2)
•Flowsensitiveな解析
•右の例で警告が出ない
•分岐で単純フォークすると
誤警告が出てしまう
def foo(x)
if x.is_a?(Integer)
x + 42
else
x + "str"
end
end
foo(42)
foo("str")
27