Skip to content

Add/simplify primitives #598

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

Merged
merged 4 commits into from
May 27, 2015
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 23, 2015

Harmonize trees with numeric types to have the same type. Dotty's alternative to Scala 2's concept of weak conformance. Review by @DarkDimius

@odersky odersky force-pushed the add/simplify-primitives branch from 60c179d to 3594109 Compare May 23, 2015 08:47
@odersky
Copy link
Contributor Author

odersky commented May 23, 2015

/rebuild

1 similar comment
@odersky
Copy link
Contributor Author

odersky commented May 23, 2015

/rebuild

@@ -386,6 +386,9 @@ object SymDenotations {
/** Is symbol a primitive value class? */
def isPrimitiveValueClass(implicit ctx: Context) = defn.ScalaValueClasses contains symbol

/** Is symbol a primitive value class? */
def isNumericValueClass(implicit ctx: Context) = defn.ScalaNumericValueClasses contains symbol
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither name nor comment explains what this method does. Comment says nothing about class being numeric, and name of the method does not say anything about class being primitive. Methods tests for both of those.

@DarkDimius
Copy link
Contributor

Otherwise LGTM.

@odersky odersky force-pushed the add/simplify-primitives branch from 3594109 to f5a70a2 Compare May 27, 2015 17:45
@odersky
Copy link
Contributor Author

odersky commented May 27, 2015

Added comments and rebased to master.

odersky added 4 commits May 27, 2015 20:08
Harmonization is Dotty's alternative to Scala 2's notion of weak conformance. It is less powerful but also
less entangled with the core type system. The idea is that in some specific contexts trees that
all have primitive numeric types will be converted as necessary so that they all have the same numeric type.
These tree sets are:

 - the two branches of an if
 - the alternatives of a match
 - the body together with the catch blocks of a try
 - the arguments of a vararg parameter

Examples are in the test file, harmonize.scala.
@odersky odersky force-pushed the add/simplify-primitives branch from f5a70a2 to d07d669 Compare May 27, 2015 18:08
odersky added a commit that referenced this pull request May 27, 2015
@odersky odersky merged commit 996ad36 into scala:master May 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants