Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scope type "type name" #2179

Closed
wenkokke opened this issue Jan 17, 2024 · 3 comments
Closed

Add scope type "type name" #2179

wenkokke opened this issue Jan 17, 2024 · 3 comments

Comments

@wenkokke
Copy link

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
--   ^^^^^
@pokey
Copy link
Member

pokey commented 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
Copy link
Author

Yes, that's way better, please deprecate "class name" and "funk name" instead!

@wenkokke wenkokke closed this as not planned Won't fix, can't repro, duplicate, stale Jan 18, 2024
@pokey
Copy link
Member

pokey commented 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 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants