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

New refactoring: Convert Method Into Getter #345

Open
nicoespeon opened this issue Jul 21, 2021 Discussed in #339 · 0 comments
Open

New refactoring: Convert Method Into Getter #345

nicoespeon opened this issue Jul 21, 2021 Discussed in #339 · 0 comments
Assignees
Labels
✨ Feature New refactoring or feature

Comments

@nicoespeon
Copy link
Owner

Discussed in #339

Originally posted by mick62 July 9, 2021
Hi,

another useful (and needed) refactoring is the change from:

class A {
  getProp(): Y
     { return expr }
}
x = myA.getProp()

to

class A {
  get prop(): Y
     { return expr }
}
x = myA.prop

Btw. the counterpart 'setProp(val)' to 'set prop(val)'
might also be of interest although we use immutable objects most of the time.

Thank you in advance

@nicoespeon nicoespeon added the ✨ Feature New refactoring or feature label Jul 21, 2021
@nicoespeon nicoespeon changed the title New refactoring: Convert Into Getter New refactoring: Convert Method Into Getter Jul 21, 2021
@nicoespeon nicoespeon self-assigned this Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature New refactoring or feature
Projects
None yet
Development

No branches or pull requests

1 participant