Skip to content

Fix #3538: Better invalidation of typed arguments in FunProtos #3661

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 3 commits into from
Dec 18, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Dec 12, 2017

One scenario we overlooked was that an argument in a FunProto might have been
computed in a context that was subsequently retracted from its typerstate (e.g.
because an enclosing subtype test failed). In that case we need to re-evaluate
the argument in order to avoid orphan typerefs.

One scenario we overlooked was that an argument in a FunProto might have been
computed in a context that was subsequently retracted from its typerstate (e.g.
because an enclosing subtype test failed). In that case we need to re-evaluate
the argument in order to avoid orphan typerefs.
@odersky odersky requested a review from smarter December 13, 2017 07:39
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -570,6 +570,14 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
private def checkNonCyclic(param: TypeParamRef)(implicit ctx: Context): Unit =
assert(!isLess(param, param), i"cyclic constraint involving $param in $this")

// ---------- Invalidation -------------------------------------------

private var retracted = false
Copy link
Member

Choose a reason for hiding this comment

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

private[this] ?

@@ -33,6 +33,12 @@ class TyperState(previous: TyperState /* | Null */) extends DotClass with Showab
myConstraint = c
}

/** Reset constraint to `c` and mark current constraint as retracted if it differs from `c` */
def resetConstraintTo(c: Constraint) = {
if (c `ne` myConstraint) myConstraint.markRetracted()
Copy link
Member

Choose a reason for hiding this comment

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

Why use backquotes around ne ? New coding style for infix calls?

@allanrenucci allanrenucci merged commit c5e595e into scala:master Dec 18, 2017
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