Typescript: Recursive type references are still disallowed in type parameter defaults

Created on 17 Oct 2019  路  5Comments  路  Source: microsoft/TypeScript

@ahejlsberg


TypeScript Version: master


Search Terms:

Code

type Tree<T, U extends Tree<T>[] = Tree<T>[]> = [T, U];

Expected behavior:
pass
Actual behavior:

$ node built/local/tsc --noEmit index.ts
index.ts:1:36 - error TS2716: Type parameter 'U' has a circular default.

1 type Tree<T, U extends Tree<T>[] = Tree<T>[]> = [T, U];
                                     ~~~~~~~~~


Found 1 error.

Playground Link:

Related Issues:

Unactionable

Most helpful comment

Is there any way we can reset this conversation to remain civil? I'll start over: could you please fill out the template completely? It would improve the chances of your issue being addressed.

Edit: It has been pointed out to me that maybe there is a communication barrier here, so I'll be as explicit as possible. Please fill out the following fields from the template:

  • search terms
  • playground link
  • related issues

The search terms and related issues are the most important as they provide context for everyone and make issues easier to find. This does take extra work on your part, but since Ryan specifically said that they are not able to take on such work themselves, it would be a good idea to comply with that request if you want your issue addressed.

In any case it's not my job to intervene, so I will disengage here unless anyone needs something specific from me. Good luck!

All 5 comments

From https://github.com/microsoft/TypeScript/issues/33616#issuecomment-541789058:

We need you to read those instructions completely, follow them, and then fill in all the fields in that template.

Looks like you've never seen other valid issues.

Is there any way we can reset this conversation to remain civil? I'll start over: could you please fill out the template completely? It would improve the chances of your issue being addressed.

Edit: It has been pointed out to me that maybe there is a communication barrier here, so I'll be as explicit as possible. Please fill out the following fields from the template:

  • search terms
  • playground link
  • related issues

The search terms and related issues are the most important as they provide context for everyone and make issues easier to find. This does take extra work on your part, but since Ryan specifically said that they are not able to take on such work themselves, it would be a good idea to comply with that request if you want your issue addressed.

In any case it's not my job to intervene, so I will disengage here unless anyone needs something specific from me. Good luck!

@falsandtru it'd be great if you would stop ccing people on post, follow the template completely, and otherwise behave a bit more constructively. I'd really appreciate it. If you continue to disregard these reasonable requests, we'll need to take other actions to ensure that everyone's able to meaningfully participate, which wouldn't be my preferred outcome.

This is an observation, not a bug report. Type aliases and type parameter defaults are separate things and enabling circular references in one doesn't change much in the other.

Since that this is an observation or not is unclear, you can't request correct judgement at all times. As I said before, other persons can't exactly know/predict your inner thoughts nor judgement without your mother. Don't make me say the same thing. I'm not your mom, right? And my cc basically specifies the correct person in charge especially when a problem is made by a new feature or a bug fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MartynasZilinskas picture MartynasZilinskas  路  3Comments

uber5001 picture uber5001  路  3Comments

Zlatkovsky picture Zlatkovsky  路  3Comments

Antony-Jones picture Antony-Jones  路  3Comments

manekinekko picture manekinekko  路  3Comments