Description
The support for reflection-ish operations on Record
may be expensive:
If a large program uses many records with named fields and contains any invocation of Record.namedFields(r)
where the static type of r
is dynamic
or Record
, it will probably be necessary to preserve the names of all named fields in records in the program (as symbols, or possibly strings, cf. #1276).
Similarly, every record would need to have run-time information about the number of positional fields if the program contains an invocation of Record.positionalFields(r)
, but that's probably not so expensive.
It's easily getting similar to operations that otherwise require 'dart:mirrors'. We might want to leave out those two static methods, or we might provide them in a separate library (say, 'dart:records', maybe as extension getters on Record
). However, it looks like this wouldn't be hard to do, because nothing else in the design depends on those methods.