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

Typescript compiler allows me to use non-existent getter #32302

Closed
mertdeg2 opened this issue Jul 8, 2019 · 3 comments
Closed

Typescript compiler allows me to use non-existent getter #32302

mertdeg2 opened this issue Jul 8, 2019 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@mertdeg2
Copy link

mertdeg2 commented Jul 8, 2019

Code

class Foo {
  constructor() {
    const x = this.bar;
  }
  set bar(value: boolean) {

  }
  //get bar() {
    //throw new Error('error');
  //}
}
const y = new Foo();

Expected behavior:
The code above doesn't compile

Actual behavior:
The code above compiles

This might be a duplicate bug, sorry I couldn't find anything that resembles this.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jul 8, 2019
@RyanCavanaugh
Copy link
Member

Please search before logging new issues. #11596

@mertdeg2
Copy link
Author

mertdeg2 commented Jul 9, 2019

Thanks! Sorry about that.

For more context:
We were trying to refactor @Input() type to @Input() set type, forgot to change all this.type instances. As a result, error was hard to debug.. since this.type is undefined. i assumed that would be a compile time error..

@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants