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 Literal Reference with recursion #88

Closed
uittorio opened this issue Nov 14, 2019 · 2 comments
Closed

Type Literal Reference with recursion #88

uittorio opened this issue Nov 14, 2019 · 2 comments
Assignees

Comments

@uittorio
Copy link
Member

this should compile correctly.

interface A {
    a: this;

    b: {
        c: string;
    }
}

It gives an error on the compiler.

Reason:
The current descriptor for typeLiteral is acting as an InterfaceDeclaration.
Because of this it will replace the current this node causing any other this reference to fail.

Solution:
We should treat typesLiteral as a different descriptor that will not store the this value.

#83

@uittorio
Copy link
Member Author

#83

Pmyl added a commit that referenced this issue Nov 20, 2019
Pmyl added a commit that referenced this issue Nov 20, 2019
…pe literal property and fix the problem

Problem fixed creating a getDescriptor function for type literal so that type literal don't modify the declaration node in the scope
Pmyl added a commit that referenced this issue Nov 20, 2019
Pmyl added a commit that referenced this issue Nov 20, 2019
…rence

* #88 add test to cover case where interface has a "this" property and a type literal

* #88 fix test to cover case where "this" property is declared after type literal property and fix the problem

Problem fixed creating a getDescriptor function for type literal so that type literal don't modify the declaration node in the scope

* #88 adjust naming and typings
@uittorio
Copy link
Member Author

This issue has been resolved in version 1.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants