Skip to content

Conversation

@retronym
Copy link
Member

@retronym retronym commented Nov 17, 2016

In the same manner as scala/scala-dev#219, the placement of the fields
phase after uncurry is presenting some challenges in keeping our trees
type correct.

This commit whacks a few more moles by adding a casts in the body of
synthetic methods.

Fixes scala/scala-dev#268

@scala-jenkins scala-jenkins added this to the 2.12.2 milestone Nov 17, 2016
@retronym
Copy link
Member Author

retronym commented Nov 17, 2016

Review by @adriaanm, 2.12.1 ?

@retronym retronym force-pushed the ticket/SD-268 branch 2 times, most recently from f8b2a75 to cd70d91 Compare November 17, 2016 08:25
@adriaanm adriaanm modified the milestones: 2.12.1, 2.12.2 Nov 17, 2016
val isUnit = isUnitGetter(lazyAccessor)
val selectVar = if (isUnit) UNIT else Select(thisRef, lazyVar)
val storeRes = if (isUnit) rhsAtSlowDef else Assign(selectVar, rhsAtSlowDef)
val storeRes = if (isUnit) rhsAtSlowDef else Assign(selectVar, fields.castHack(rhsAtSlowDef, lazyVar.info.resultType))
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need resultType here? I think the lazyVar symbol is synthesized by us (which means we don't need ASF, and straight up info should be good)

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed. I probably wasn't sure if this the symbol was a method (with a NullaryType to be stripped with resultType) or a field when I wrote that...

In the same manner as scala/scala-dev#219, the placement of the fields
phase after uncurry is presenting some challenges in keeping our trees
type correct.

This commit whacks a few more moles by adding a casts in the body of
synthetic methods.

Fixes scala/scala-dev#268
@adriaanm
Copy link
Contributor

LGTM

s/mole/pancake/

@adriaanm adriaanm merged commit 71a2cad into scala:2.12.x Nov 30, 2016
milessabin added a commit to milessabin/scala that referenced this pull request Aug 14, 2018
Following on from scala#5536 this commit adds another
fields.castHack in AccessorSynthesis#expandLazyClassMember to deal with
numeric but singleton typed numeric fields which would otherwise be
widened by numericLub.

Fixes scala/bug#11071.
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