18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/steep/annotations_helper.rb', line 18
def deprecated_type_name?(type_name, env)
annotations =
case
when type_name.class?
case
when decl = env.class_decls.fetch(type_name, nil)
decl.each_decl.flat_map do |decl|
if decl.is_a?(RBS::AST::Declarations::Base)
decl.annotations
else
[]
end
end
when decl = env.class_alias_decls.fetch(type_name, nil)
if decl.decl.is_a?(RBS::AST::Declarations::Base)
decl.decl.annotations
else
[] end
end
when type_name.interface?
if decl = env.interface_decls.fetch(type_name, nil)
decl.decl.annotations
end
when type_name.alias?
if decl = env.type_alias_decls.fetch(type_name, nil)
decl.decl.annotations
end
end
if annotations
deprecated_annotation?(annotations)
end
end
|