External type hint inconsistency between regular functions and primitive functions

Description

Consider the following example.

As expected this does not warn about reflection. The following example shows the same scenario for a primitive function.

So the behavior of external type hints is inconsistent for regular functions and primitive functions.
Most likely, the external type hint information is somehow ignored for primitive functions since the case where they return no primitive value is not treated separately.

Environment

None

Status

Assignee

Unassigned

Reporter

import

Labels

Approval

Triaged

Patch

Code

Affects versions

Priority

Minor
Configure