-   Notifications  
You must be signed in to change notification settings  - Fork 1.1k
 
Fix isSourceMethod #519
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
Fix isSourceMethod #519
Conversation
|   Would it not be simpler if companionMethods did not have the   |  
|   @smarter Does this distinction manifest itself currently? @odersky than they would behave as fields. Wouldn't it be better to add a check for absence of   |  
|   On Fri, May 1, 2015 at 10:18 PM, Dmitry Petrashko notifications@github.com 
 In what sense? 
 Yes, we 
 Martin Odersky  |  
|   Reading once again documentation and implementation of  And why would ValueClasses not be applied to   |  
 
 No, this commit should not have any functional change, it just seemed cleaner. 
 As @odersky said, the name of the method is probably incorrect. For value classes the synthetic methods generated by   |  
|   Ok, lets concentrate on what does this method do in value classes: I'd prefer to have all cases concentrated in single place:  So I'd say we should just inline whole body of   |  
 
 Fields are handled differently by some phases, eg backend discovers fields not based on trees, but based on types. So if we'll mark companion methods as fields I'll need to filter them out there(which is not a problem, but I see no reason to remove filtering in one place to introduce in another)  |  
|   
  |  
|   
  |  
|   Looking at the use sites of isSourceMethods, the effects of being a SourceMethod seem to be: 
 It's true that companion methods should not count as source methods in that sense. So the changes LGTM. @smarter: Maybe add a comment on isSourceMethod that distills our collective findings? If we can;t find a better name at least we can make clear what we mean by the name it has.  |  
|   Precisely because of absence of a good name, I would better separate this method in three different ones, and give them names indicating their usage.  |  
|   I believe splitting into different ones will cause complexity elsewhere. Let's rename to   |  
|   @smarter Can you do the rename and add the comments? I'll merge once that 's in.  |  
|   @odersky : do you consider   |  
|   No On Wed, May 6, 2015 at 3:20 PM, Guillaume Martres notifications@github.com 
 Martin Odersky  |  
77b425f to 839e47c   Compare   |   @odersky : I updated the PR.  |  
|   LGTM, thanks!  |  
Review by @DarkDimius .