Before or after deserialization?
The compiler has the information for currently compiled declarations, but the type argument information is lost if you look up already compiled declarations (from different modules or other incremental compilation rounds).
I had to add super hacky workarounds to my compiler plugin because it relies on annotations with type arguments.
Basically I store all types(parameter types, return types) of the declaration (function, property, class) in a json string and add a annotation with the json string to the declaration itself. Then later in different compilations I can read the annotation with the correct types.
You can check it out here:
https://github.com/IVIanuu/injekt/blob/master/compiler/src/main/kotlin/com/ivianuu/injekt/compiler/frontend/InfoPatcher.kt