As a followup to #11963 and in preparation for #12085, we want to move the representation of whether or not libraries are virtual into a cleaner and safer encoding in the type system. @rgrinberg noted the value of this improvement in #12002 (comment) . The motivating need here is to reduce the chance of introducing defects while reasoning about implementable libraries, to be added in #11963.
Currently, we represent whether or not a library is virtual via the boolean record field virtual_ in Lib_info.t. However, this property is in fact disjoint with the alternatives in Lib_kind.t, which we record in Lib_info.kind. This leaves us with the suboptimal situation of making it possible to construct invalid values of type Lib_info.t, such as {... virtual_: true; parameter = true; ...}. By instead representing virtuality as one of the alternatives of Lib_kind.t, we will accurately represent the mutual incompatibility between the property of being virtual and the other possible kinds, making it impossible to represent invalid libraries in this way, and statically eliminating a category of error that is otherwise possible when moving forward with #12085.