Skip to content

Type Propagation cannot resolve T in constructorless class #1119

@jtenner

Description

@jtenner
class NestedForInlineA<T> {
  a: NestedForInlineB<T> = new NestedForInlineB<T>();
}

class NestedForInlineB<T> {
  b: NestedForInlineC<T> = new NestedForInlineC<T>();
}

class NestedForInlineC<T> {
  c: T;
}
ERROR TS2304: Cannot find name 'T'.

   a: NestedForInlineB<T> = new NestedForInlineB<T>();
                                                 ~    
 in assembly/jest-log.ts(108,48)

So... I'm pretty sure that's because the GenericContext flag isn't being set, or the type information isn't resolving for some reason. Of course, I have workarounds for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions