Skip to content

Redesign Tuples with HList-like structure #2199

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

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove dependency between dotty-compiler and dotty-library
  • Loading branch information
OlivierBlanvillain committed May 1, 2017
commit 9f4fca665952c1112fefcd7127e8cc86b2129eb5
2 changes: 0 additions & 2 deletions compiler/src/dotty/tools/dotc/core/Denotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ import Decorators.SymbolIteratorDecorator
*/
object Denotations {

implicit def eqDenotation: Eq[Denotation, Denotation] = Eq

Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this removed? Do we really want to compare denotations with arbitrary types for equality? This is dangerous as it is all too easy to compare a symbol with a denotation and get constant false!

/** A denotation is the result of resolving
* a name (either simple identifier or select) during a given period.
*
Expand Down
2 changes: 0 additions & 2 deletions compiler/src/dotty/tools/dotc/core/Names.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ object Names {
def toTermName: TermName
}

implicit def eqName: Eq[Name, Name] = Eq
Copy link
Contributor

Choose a reason for hiding this comment

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

Same remark as for Denotations applies: Please don't remove multiversal equality markers.


/** A name is essentially a string, with three differences
* 1. Names belong in one of two name spaces: they are type names or term names.
* Term names have a sub-category of "local" field names.
Expand Down
2 changes: 0 additions & 2 deletions compiler/src/dotty/tools/dotc/core/Symbols.scala
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,6 @@ trait Symbols { this: Context =>

object Symbols {

implicit def eqSymbol: Eq[Symbol, Symbol] = Eq
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto


/** A Symbol represents a Scala definition/declaration or a package.
* @param coord The coordinates of the symbol (a position or an index)
* @param id A unique identifier of the symbol (unique per ContextBase)
Expand Down
2 changes: 0 additions & 2 deletions compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ object Types {

@sharable private var nextId = 0

implicit def eqType: Eq[Type, Type] = Eq
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto


/** Main class representing types.
*
* The principal subclasses and sub-objects are as follows:
Expand Down
18 changes: 10 additions & 8 deletions compiler/src/dotty/tools/dotc/transform/LazyVals.scala
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ class LazyVals extends MiniPhaseTransform with IdentityDenotTransformer {
// compute or create appropriate offsetSymol, bitmap and bits used by current ValDef
appendOffsetDefs.get(claz) match {
case Some(info) =>
val flagsPerLong = (64 / dotty.runtime.LazyVals.BITS_PER_LAZY_VAL).toInt
val BITS_PER_LAZY_VAL = 2L // To be kept in sync with dotty.runtime.LazyVals.BITS_PER_LAZY_VAL
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be a big step back to me.

val flagsPerLong = (64 / BITS_PER_LAZY_VAL).toInt
info.ord += 1
ord = info.ord % flagsPerLong
val id = info.ord / flagsPerLong
Expand Down Expand Up @@ -400,14 +401,15 @@ class LazyVals extends MiniPhaseTransform with IdentityDenotTransformer {
object LazyVals {
object lazyNme {
object RLazyVals {
import dotty.runtime.LazyVals._
val get = Names.get.toTermName
val setFlag = Names.setFlag.toTermName
val wait4Notification = Names.wait4Notification.toTermName
val state = Names.state.toTermName
val cas = Names.cas.toTermName
val getOffset = Names.getOffset.toTermName
// To be kept in sync with dotty.runtime.LazyVals.Names._
val cas = "CAS".toTermName
val get = "get".toTermName
val getOffset = "getOffset".toTermName
val setFlag = "setFlag".toTermName
val state = "STATE".toTermName
val wait4Notification = "wait4Notification".toTermName
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing. Sorry, but this is crazy.


val flag = "flag".toTermName
val result = "result".toTermName
val value = "value".toTermName
Expand Down
4 changes: 2 additions & 2 deletions library/src/dotty/runtime/LazyVals.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import scala.annotation.tailrec
object LazyVals {
private val unsafe = scala.concurrent.util.Unsafe.instance

final val BITS_PER_LAZY_VAL = 2L
final val BITS_PER_LAZY_VAL = 2L // To be kept in sync with dotty/tools/dotc/transform/LazyVals.scala
final val LAZY_VAL_MASK = 3L
final val debug = false

Expand Down Expand Up @@ -91,7 +91,7 @@ object LazyVals {
r
}

object Names {
object Names { // To be kept in sync with dotty/tools/dotc/transform/LazyVals.scala
final val state = "STATE"
final val cas = "CAS"
final val setFlag = "setFlag"
Expand Down