core: Handle boxing in exported and imported types