- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 88
Not planned
Description
The scope types include "class name" and "funk name" to match the names in, e.g., class and function declarations. However, it does not include a "type name" to match the name in a type declaration. I propose we add such a scope type.
// TypeScript
export type Tuple[A, B] = [A, B]
// ^^^^^
# Python
_A = TypeVar("_A")
_B = TypeVar("_B")
Tuple: TypeAlias = tuple[_A, _B]
#^^^^
-- Haskell
type Tuple a b = (a, b)
-- ^^^^^
data Tuple a b = Tuple a b
-- ^^^^^
Activity
pokey commentedon Jan 17, 2024
We've actually been considering deprecating "funk name" and "class name" as they're now almost completely equivalent to just chaining modifiers: "name funk" and "name class". They're a holdover from before modifiers could be chained. See #1518 for more discussion
I could see a consistency argument for supporting "type name" if we support "class name", but note that these scope types technically introduce ambiguity because "type name" could be parsed as a modifier chain: select name then select type
wenkokke commentedon Jan 18, 2024
Yes, that's way better, please deprecate "class name" and "funk name" instead!
pokey commentedon Jan 18, 2024
We'd love to deprecate those, but unfortunately we don't have a good answer for the exceptional case mentioned in the description of #1518 😕