Skip to content

Commit eae4ebb

Browse files
committed
Fix Record type
1 parent 902ff7b commit eae4ebb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

sig/types.rbs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,23 @@ module RBS
301301
end
302302

303303
class Record
304-
attr_reader all_fields: Hash[Symbol, [t, bool]]
304+
type key = Symbol | String | Integer | bool
305305

306-
attr_reader fields: Hash[Symbol, t]
306+
# All types of all files
307+
#
308+
# If the key is *required*, the second value of the tuple is `true`.
309+
# If the key is *optional*, the second value of the tuple is `false`.
310+
#
311+
attr_reader all_fields: Hash[key, [t, bool]]
312+
313+
attr_reader fields: Hash[key, t]
307314

308-
attr_reader optional_fields: Hash[Symbol, t]
315+
attr_reader optional_fields: Hash[key, t]
309316

310317
type loc = Location[bot, bot]
311318

312-
def initialize: (fields: Hash[Symbol, t], location: loc?) -> void
313-
| (all_fields: Hash[Symbol, [t, bool]], location: loc?) -> void
319+
def initialize: (fields: Hash[key, t], location: loc?) -> void
320+
| (all_fields: Hash[key, [t, bool]], location: loc?) -> void
314321

315322
include _TypeBase
316323

0 commit comments

Comments
 (0)