DeclProvider::type_decl
Summary:
Thinking ahead to a world where symbols and decls are typesafe, the primary
interface to DeclProvider should not launder names as strings, and hackc should
be able to expect a decl type that matches the symbol type.
To get started, introduce a provided method to the DeclProvider trait for
getting type decls, and encapsulate some error checking related to unexpected
decl types. Later it can accept a TypeName.
A good litmus test (goal?) is for oxidized_by_ref::Decl (an enum of every kind of decl)
to be an implementation detail and not exposed in significant APIs, because
it bakes in the wrong idea that any symbol can map to any decl.
Reviewed By: shayne-fletcher
Differential Revision:
D36395990
fbshipit-source-id:
643f0abc3e06428a859b357979682e8ca4384574