Skip to content

bug(semantic): typeof operator on type imports not counted as a reference #4494

@DonIsaac

Description

@DonIsaac

Part of #4445. Found by @camc314.

import type { mySchema } from './my-schema';
function test(arg: ReturnType<typeof mySchema>) {
  //                          ^^^^^^^^^^^^^^^ should be a `Type` reference
    arg;
}
test('');

Note that non-type imports work as expected:

import { mySchema } from './my-schema';
function test(arg: ReturnType<typeof mySchema>) {
    arg;
}
test('');

Screenshots

Incorrect:
image
Correct:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-semanticArea - SemanticC-bugCategory - Buggood first issueExperience Level - Good for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions