Skip to content

Conversation

@DarkDimius
Copy link
Contributor

No description provided.

@DarkDimius
Copy link
Contributor Author

@smarter please review.

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be a -Y option? It's a "compiler hacker" option and it's a bit dangerous since toggling it can break an API since it changes method signatures.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would actually be using it during my everyday development and would recommend others, because it simplifies debugging. So I'd not consider it as "compiler hacker" option.
Though I'm fine with it being either -X or -Y

@DarkDimius
Copy link
Contributor Author

sbt.ResolveException: unresolved dependency: com.typesafe#config;1.2.0: not found

restarting build.

@odersky
Copy link
Contributor

odersky commented May 2, 2015

Otherwise LGTM

Copy link
Member

Choose a reason for hiding this comment

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

Value classes which are not case classes will not implement productPrefix, this should not be here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Scalac actually synthesizes toString on value classes, which is productPrefix + hex-encoded underlying value.
I belive that always implementing productPrefix does make sense.

DarkDimius added 15 commits May 5, 2015 20:08
Making actual value classes extend this prototypes serves two goals:
 - This is a basis for implementing arrays of value classes.
 - Having underlying final in those glasses makes all unbox methods monomorphic and final.
 - this decreases size of an empty case-class to 1/3 of previous size.
Decreases the size of companion of case value class to 1/8 of it's original size.
Works as Array[T] is erased to Object.
Unfortunately needed to sacrifice the immutability of inner field.
[error] /Users/dark/workspace/dotty/src/dotty/runtime/vc/VCPrototype.scala:10: overriding method clone in class VCArrayPrototype of type ()Object;
[error]  method clone in class Object of type ()Object has weaker access privileges; it should be public;
[error]  (Note that method clone in class VCArrayPrototype of type ()Object is abstract,
[error]   and is therefore overridden by concrete method clone in class Object of type ()Object)
[error] abstract class VCArrayPrototype[T <: VCPrototype] extends Object with Cloneable {
It can be done with non-abstract rhs of method.
@DarkDimius DarkDimius force-pushed the classTags branch 2 times, most recently from c7e7cc5 to 9d8a8de Compare May 5, 2015 19:20
DarkDimius added a commit that referenced this pull request May 13, 2015
Forked ScalaRuntime and minimal classtags for arrays of value classes.
@DarkDimius DarkDimius merged commit 31fbfcc into scala:master May 13, 2015
@smarter smarter deleted the classTags branch June 8, 2017 13:09
tgodzik added a commit that referenced this pull request Aug 13, 2025
Backport "Use result of lambda type of implicit in CheckUnused" to 3.3 LTS
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.

3 participants