X Tutup
Skip to content

Cannot read properties of undefined (reading 'parent') #1325

@denis-atsuta

Description

@denis-atsuta

When updating a project from 1.6.2 to 1.8.0, I encountered an error:

\node_modules\typescript-to-lua\dist\transformation\builtins\index.js:114
    const ownerSymbol = callSymbol.parent;
                                   ^
TypeError: Cannot read properties of undefined (reading 'parent')

code to reproduce error:

function test<T>(iterator: Iterator<T, T>) {
    iterator.return && iterator.return();
}

https://typescripttolua.github.io/play/#code/GYVwdgxgLglg9mABFApgZygHgCoD4AUMqATgIZRzEBciAkieZTgDSJ4CUiA3gFCL+IiKMhWIA6YiighiSAGRzBDURKkyw+dgG4eAXyA

In version 1.6.2 this code works

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup