File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -40,15 +40,15 @@ def alias_type(key, target_key)
40
40
end
41
41
42
42
protected
43
- def perform_fetch ( lookup_key )
43
+ def perform_fetch ( lookup_key , & block )
44
44
matching_pair = @mapping . reverse_each . detect do |key , _ |
45
45
key === lookup_key
46
46
end
47
47
48
48
if matching_pair
49
49
matching_pair . last . call ( lookup_key )
50
50
elsif @parent
51
- @parent . perform_fetch ( lookup_key )
51
+ @parent . perform_fetch ( lookup_key , & block )
52
52
else
53
53
yield lookup_key
54
54
end
Original file line number Diff line number Diff line change @@ -143,6 +143,13 @@ def test_parent_fallback
143
143
assert_equal boolean , mapping . lookup ( "boolean" )
144
144
end
145
145
146
+ def test_parent_fallback_for_default_type
147
+ parent = klass . new
148
+ mapping = klass . new ( parent )
149
+
150
+ assert_kind_of Value , mapping . lookup ( :undefined )
151
+ end
152
+
146
153
private
147
154
def klass
148
155
TypeMap
You can’t perform that action at this time.
0 commit comments