Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Generics types can't be generic #149

Open
munizart opened this issue Apr 22, 2020 · 3 comments
Open

Generics types can't be generic #149

munizart opened this issue Apr 22, 2020 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@munizart
Copy link

IMHO, this should typecheck

type T<K> = K
type ApplyNumber<T> = T<number>
const x : ApplyNumber<T> = 3
@JSMonk
Copy link
Owner

JSMonk commented Apr 23, 2020

Oh, okay. Will fix it. Thank you for your contribution ^_^

@JSMonk JSMonk added the duplicate This issue or pull request already exists label Apr 24, 2020
@JSMonk
Copy link
Owner

JSMonk commented Apr 24, 2020

And also it's duplicate Issue #2

@citizengabe
Copy link

There appear to be a couple of issues at play here.

  1. Apply undeclareted generic type 'T' on line 2. Ideally, the generic type wouldn't have to be declared and could instead be inferred. But barring that, it would be nice to be able to declare that within the definition of ApplyNumber.
  2. Generic type "T" should be used with type paramteres! on line 3. This is an issue with partially applying generic types.

They're both related to #2, but I don't know that they're necessarily duplicates.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants