srowen commented on issue #23903: [SPARK-26977][CORE] Fix warn against 
subclassing scala.App
URL: https://github.com/apache/spark/pull/23903#issuecomment-467933318
 
 
   I just tried compiling `object MyApp extends scala.App` with Scala 2.12 and 
I get in the bytecode...
   `public final class MyApp$ implements scala/App`.
   `class MyApp extends scala.App` yields `public class MyApp implements 
scala/App`. I don't see any `childMainClass`, etc.
   
   I am actually not sure if this ever worked with the `class` version... it 
tries to invoke a static main() method, but these classes don't get a static 
main(); they get a non-static main() though.
   
   I find that the current check works if you check whether "MyApp$" extends 
`scala.App`.
   I'd suggest we just add that to the condition?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to