Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[resubmit] Experimental Single Abstract Method support (sammy meets world) #3037
This is resubmission of #3018 after merge conflict has been resolved.
The expansion assumes
We may later relax these requirements to allow an implicit argument list, both on the constructor and the SAM. Could also let the SAM be polymorphic.
PS: We'll require
added a commit
this pull request
Oct 14, 2013
Oct 14, 2013
1 check passed
So, 'import language.sam' does not work on Scala 2.11. I suppose the -Xexperimental part was not changed? I can not find any info about this other than this PR, especially with respect to how to use it (via language import or experimental flag). Any idea when it will be available by import? 2.12 (a long time from now) or 2.11.future (not too distant)?
It's available in 2.11.5-SNAPSHOT under -Xexperimental. Happy to hear about bugs! It works for me with the Java 8 Streams API except for a couple of rough edges around type inference because we do not support wildcard capture. Will be available under language flag in 2.12 but with same functionality.
Well, I'm not sure I'll enable -Xexperimental (and all the other undocumented stuff that may or may not turn on) on my builds for production code to test it out, and test whether or not it propagates through to everyone's development environments without issue. ScalaIDE is flaky enough as is.
That is a lot more work than adding an import statement.
So far, its been easier to add some implicits for the SAM types I want.
That would work. I'll still have to go through all of the development environment testing to ensure the flag works its way from maven through to the IDEs without manual intervention before pushing a change, but at least I would not need to wonder what else it enabled and it would be easier to explain and justify as a stand-alone item.
As a result, until Scala IDE (and IntelliJ, which may or may not work as I have not tested) pick up the additional configuration flags automatically, setting this on non-sbt projects would probably get me hanged. Of course, the non-sbt projects happen to be the java-scala hybrids, where this feature would be particularly useful.
I'll bring this up with the Scala IDE folk tomorrow, perhaps I'm missing something.