Skip to content

Conversation

@liufengyun
Copy link
Contributor

Reverts #3354

@odersky : I'm not sure exactly what you proposed here. Could you elaborate more or take this over?

@allanrenucci
Copy link
Contributor

allanrenucci commented Oct 23, 2017

My understanding was to try this instead:

-     if (ctx.mode.is(Mode.ImplicitsEnabled))
+     if (ctx.mode.is(Mode.ImplicitsEnabled)) {
+       val savedConstraint = ctx.typerState.constraint
        inferView(tree, pt) match {
          case SearchSuccess(inferred, _, _, _) =>
            adapt(inferred, pt)(ctx.retractMode(Mode.ImplicitsEnabled))
          case failure: SearchFailure =>
+           ctx.typerState.constraint = savedConstraint
            if (pt.isInstanceOf[ProtoType] && !failure.isInstanceOf[AmbiguousImplicits])
              // don't report the failure but return the tree unchanged. This
              // wil cause a failure at the next level out, which usually gives
              // a better error message.
              tree
            else recover(failure)
        }
+     }

@liufengyun
Copy link
Contributor Author

Thanks @allanrenucci . Unfortunately this doesn't work, as the real problem is the shared typerstate, saving the constraint doesn't help here.

@odersky
Copy link
Contributor

odersky commented Oct 24, 2017

test performance please

@dottybot
Copy link
Member

performance test scheduled: 1 job(s) in queue, 0 running.

@odersky
Copy link
Contributor

odersky commented Oct 24, 2017

@liufengyun I think we should just drop the assertion in implicitSearch. I don't see a reason after all why attempted completions should be undone, so we have to admit that they can influence the constraints.

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/3370/ to see the changes.

Benchmarks is based on merging with master (e1365d9)

@allanrenucci
Copy link
Contributor

I you keep working on this, can you reopen from dotty-staging as every push to lampepfl/dotty triggers a build

@liufengyun
Copy link
Contributor Author

Superseded by #3374.

@liufengyun liufengyun closed this Oct 24, 2017
@allanrenucci allanrenucci deleted the revert-3354-fix-3348 branch October 24, 2017 11:32
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.

5 participants