Skip to content

[bug?] instanceof check with Set using indexof fails  #1105

@jtenner

Description

@jtenner

Given a type T of any kind, the following lines of code yield a compiler error that points to ~lib/set.ts

function example<T>(ref: T): void {
  if (ref instanceof Set<indexof<T>>) {  // problem here

  }
}
ERROR TS2304: Cannot find name 'T'.

       if (ref instanceof Set<indexof<T>>)  {
                                      ~
 in assembly/internal/Reflect.ts(61,38)

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