-
Notifications
You must be signed in to change notification settings - Fork 21
Implicit resolution doesn't work with -Yrepl-class-based in REPL #9799
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
Comments
Shixiong Zhu (zsxwing) said (edited on Jun 1, 2016 10:03:29 PM UTC): |
@som-snytt said: and earlier PR "This stuff is really subtle." -- scala/scala#4522 |
Shixiong Zhu (zsxwing) said: |
Prashant Sharma (scrapcodes) said (edited on Jun 6, 2016 10:19:15 AM UTC): @som-snytt Do we have a way to know what all implicit imports are required by a particular expression ? The same way as |
@som-snytt said (edited on Jun 6, 2016 8:06:44 PM UTC): Unused imports don't affect binaries; I don't know if the problem you're asking about relates to remote execution or remote compilation. To respond to the question about limiting imports, I could speculate that -Ywarn-unused-import could be used to strip unused imports from the generated source. That is, compile with eager imports, check the warnings, strip unused imports and then recompile. (Linking the issue that would benefit from that mode.) The issue linked from the PR: https://issues.apache.org/jira/browse/SPARK-1199 |
Shixiong Zhu (zsxwing) said (edited on Aug 17, 2016 6:02:03 PM UTC): scala -Yrepl-class-based
scala> import java.io.File
import java.io.File
scala> class Test {val f=new File(".")}
<console>:11: error: not found: type File
class Test {val f=new File(".")} If we cannot get the correct wanted imports, I would suggest just removing this wrong optimization. |
@som-snytt said: For implicits, one idea is to take the candidate imports and add them until it compiles. That would change the possibly rare use case of imports introducing ambiguous implicits. Better would be improved control of import history, which was proposed once. |
@som-snytt said: |
Shixiong Zhu (zsxwing) said: bin/scala -Yrepl-class-based
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45).
Type in expressions for evaluation. Or try :help.
scala> import java.text._
import java.text._
scala> class Foo() { val f = new SimpleDateFormat("hh") }
<console>:11: error: not found: type SimpleDateFormat
class Foo() { val f = new SimpleDateFormat("hh") } |
@som-snytt said: |
Denis Bolshakov (dbolshak) said: Could you please check that https://issues.apache.org/jira/browse/SPARK-17103 is reproducible with scala 2.11.9? |
Shixiong Zhu (zsxwing) said: |
The following codes failed when enabling -Yrepl-class-based.
The above codes work well when disabling -Yrepl-class-based
The text was updated successfully, but these errors were encountered: