mirror of https://github.com/astral-sh/ruff
18 lines
378 B
Python
18 lines
378 B
Python
"""Test that type parameters are considered used."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from collections.abc import Callable
|
|
|
|
from .foo import Record as Record1
|
|
from .bar import Record as Record2
|
|
|
|
type RecordCallback[R: Record1] = Callable[[R], None]
|
|
|
|
|
|
def process_record[R: Record2](record: R) -> None:
|
|
...
|