Skip to content

Fix #7758: Avoid stackoverflows after inline attempts #7764

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 2 commits into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
// Precondition: !isSubType(tp1, tp2) && !isSubType(tp2, tp1).
if (!ctx.explicitNulls && (tp1.isNullType || tp2.isNullType)) {
// Since projections of types don't include null, intersection with null is empty.
return Empty
Empty
}
else {
val res = ctx.typeComparer.provablyDisjoint(tp1, tp2)
Expand Down
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2826,7 +2826,8 @@ class Typer extends Namer
tree.tpe <:< wildApprox(pt)
val errorCount = ctx.reporter.errorCount
val inlined = Inliner.inlineCall(tree)
if (errorCount == ctx.reporter.errorCount) readaptSimplified(inlined) else inlined
if ((inlined ne tree) && errorCount == ctx.reporter.errorCount) readaptSimplified(inlined)
else inlined
}
else if (tree.symbol.isScala2Macro &&
// raw and s are eliminated by the StringInterpolatorOpt phase
Expand Down
1 change: 1 addition & 0 deletions tests/neg/i7758.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
def f: Int = implicitly: Int // error