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

type: class expression that extends passed argument of generic TypeConstructor is reported incorrectly by typeChecker as intersection of types #49116

Closed
armano2 opened this issue May 15, 2022 · 1 comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@armano2
Copy link

armano2 commented May 15, 2022

Bug Report

πŸ”Ž Search Terms

  • type
  • generic extends
  • class expression

πŸ•— Version & Regression Information

  • This allways reported incorrect data tested between versions 3.3.x and 4.6.2

⏯ Playground Link

Playground Link

Typescript Eslint

Ast Explorer

πŸ’» Code

function ClassWithName<TBase extends new (...args: any[]) => {}>(Base: TBase) {
	return class A extends Base {
	}
}

πŸ™ Actual behavior

Type of ClassExpression that extends generic not default TypeConstructor is incorrectly reported as Intersection without symbol set

image

πŸ™‚ Expected behavior

i expect to receive object with type TypeObject that has Object typeFlag set and properly defined symbol

This issue is present only if we extend class by other class thatr is provided by arg of function <TBase extends new (...args: any[]) => {}>(Base: TBase) and only if its a generic (template)

ref: typescript-eslint/typescript-eslint#4974

@andrewbranch
Copy link
Member

#13743

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

2 participants