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

Getter/Setter Parsing Issues #19

Closed
chadhietala opened this issue May 26, 2022 · 0 comments · Fixed by #23
Closed

Getter/Setter Parsing Issues #19

chadhietala opened this issue May 26, 2022 · 0 comments · Fixed by #23

Comments

@chadhietala
Copy link
Contributor

chadhietala commented May 26, 2022

Description:

When you have a paired getter and setter on a class or object they loose their name. If you have an object with a setter on it, it is never parser out.

Failing Spec:

export const bar = {
  get foo(): string {
    return 'ss'
  },
  
  set foo(foo: string) {

  }
}

export class Example {
  get foo(): string {
    return 'ss'
  },
  
  set foo(foo: string): void {

  }
}

Playground Link:
https://structured-types.vercel.app/?code=%22export%20const%20bar%20%3D%20%7B%5Cn%20%20get%20foo%28%29%3A%20string%20%7B%5Cn%20%20%20%20return%20%27ss%27%5Cn%20%20%7D%2C%5Cn%20%20%5Cn%20%20set%20foo%28foo%3A%20string%29%20%7B%5Cn%5Cn%20%20%7D%5Cn%7D%5Cn%5Cnexport%20class%20Example%20%7B%5Cn%20%20get%20foo%28%29%3A%20string%20%7B%5Cn%20%20%20%20return%20%27ss%27%5Cn%20%20%7D%2C%5Cn%20%20%5Cn%20%20set%20foo%28foo%3A%20string%29%3A%20void%20%7B%5Cn%5Cn%20%20%7D%5Cn%7D%22

Expectation

The getter setter should be parsed out like all other properties.

Screen Shot 2022-05-26 at 8 25 32 AM

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

Successfully merging a pull request may close this issue.

1 participant