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

SI-8918 Unary ids are plain ids #4059

Closed
wants to merge 140 commits into from
Closed

Conversation

som-snytt
Copy link
Contributor

Allow +,-,!,~ to be used as unprefixed identifiers.

As prefix operators, they must be followed by
a simple expression, so otherwise, consume the
id itself as the start of a simple expression.

retronym and others added 30 commits May 6, 2014 13:23
For this step, we still depend on _2.11 libraries (partest, xml,
parser-combinators).

After we release the first milestone of 2.12, we will update
versions.property to bootstrap to 2.12 dependencies.
Since identity[A] is often used as a function directly supplied to
methods requiring (A)=>A, there's no need to have the generated
Function1 object contain an explicit call to identity[A]().

This implementation isn't going to change, so let the synthetic
Function1 elide the extra call, generating just "aload_1; areturn".
This shaves a few kB off of the generated class file.
Make PartialFunction.OrElse extend AbstractPartialFunction.
Corrected api doc for >> operator to say it bit-shifts right rather than left, and fills the left bits rather than the right bit
…ler is responsible for checking 'isDefinedAt'
…ler is responsible for checking 'isDefinedAt'
See e2a3498 commit message for explanation

Explicit private declaration better than implicit
Thanks to @som-snytt
allows users to write a single function for dealing with Input/Output
streams and Sources. It also allows Source to be used in
"try-with-resources" statements in Java > 7.

No tests since this is a binary and source compatible change.
Ichoran and others added 13 commits January 8, 2015 15:14
Fixed all copyToArray methods to do exactly what the docs say
they do, with the least-suprise behavior of not throwing an
exception if you ask to copy nothing (but would have copied out of
range).

Iterator had an undocumented requirement for the target index to
be in range regardless if anything happened; this has been removed.
Constant folding was incorrectly promoting to Long when the
operand was Long, as with other binary ops, but the result
type depends on the receiver.

Per SLS 12.2.1.

This fixes ((1 << 2L): Int) and the other shift ops and
the other integral types.
SI-8462: Int shift Long result corrected
SI-8944 A more resiliant naming scheme for case accessors
SI-8519  collection.immutable.Map.apply is inefficient
SI-9030 make BoxesRunTime.equalsNumChar public
SI-7128  copyToArray(xs, 0, 0) should not fail
Conflicts:
	build.number
	src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
	src/library/scala/collection/Iterator.scala
	versions.properties
…2.x-20150129

Conflicts:
	build.number
	src/library/scala/concurrent/Future.scala
	versions.properties
@lrytz
Copy link
Member

lrytz commented Feb 3, 2015

opinions on this change? maybe in 2.12? /cc @adriaanm @gkossakowski @retronym @Alefas

@gkossakowski
Copy link
Member

Although it doesn't change grammar, I'd be in favour of putting this into 2.12.x and highlighting in release notes.

@adriaanm
Copy link
Contributor

adriaanm commented Feb 3, 2015

+1 on moving to 2.12

@som-snytt
Copy link
Contributor Author

OK, OK! Agreed. It's not backwardly source-bug-compatible, so if you used it in your 2.11.6 project, I couldn't compile with 2.11.5.

It means that folks won't be able to do this for a long time. I hope they don't riot.

Or lodge too many duplicate issues.

@som-snytt som-snytt closed this Feb 3, 2015
Allow +,-,!,~ to be used as unprefixed identifiers.

As prefix operators, they must be followed by
a simple expression, so otherwise, consume the
id itself as the start of a simple expression.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet