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 inference via auto_type #26

Closed
nguyenhuy opened this issue Apr 18, 2017 · 3 comments
Closed

Type inference via auto_type #26

nguyenhuy opened this issue Apr 18, 2017 · 3 comments
Labels

Comments

@nguyenhuy
Copy link
Member

nguyenhuy commented Apr 18, 2017

Having type inference would be helpful in many cases. Details can be found in this great blog post. Let me know what you all think!

P/S: If we decide to introduce this, we need to update our coding guidelines.

@Adlai-Holler Adlai-Holler changed the title [RFC] Type inference via auto_type Type inference via auto_type Apr 19, 2017
@Adlai-Holler
Copy link
Member

Adlai-Holler commented Apr 19, 2017

For the time being, a couple thoughts:

  • Using let and var macros inconsistently in a public framework seems unprofessional to me.
  • __auto_type can interfere with SourceKit, making development slightly more frustrating.
  • __auto_type on its own is ugly but useful in cases like NSMapTable<NSString *, ASDisplayNode *> *mapTable = [self generateMapTable]
  • Maybe it would be appropriate to use __auto_type directly but sparingly, in cases where it makes sense, up to the discretion of the coder. NSArray<NSString *> * may not justify it, for example.

@maicki
Copy link
Contributor

maicki commented Apr 25, 2017

I'm sharing the opinion of @Adlai-Holler:

  • We should not introduce let and var as it's not common standard
  • Using __auto_type can be cumbersome
  • We should slowly introduce it in places where it makes sense e.g. for blocks etc.

@nguyenhuy
Copy link
Member Author

Thanks for the thoughtful feedbacks. Let's use __auto_type on a case by case basic and don't introduce project-wise let and var macros. Closing this RFC.

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

No branches or pull requests

3 participants