-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8912 from dotty-staging/fix-#8892
Fix #8892: Fix position adjustments in Inliner
- Loading branch information
Showing
5 changed files
with
47 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
trait Reporter: | ||
def report(m: String): Unit | ||
|
||
class Dummy extends Reporter: | ||
def report(m: String) = () | ||
|
||
object ABug { | ||
sealed trait Nat { | ||
inline def ++ : Succ[this.type] = Succ(this) | ||
|
||
transparent inline def +(inline that: Nat): Nat = | ||
inline this match { | ||
case Zero => that | ||
case Succ(p) => p + that.++ | ||
} | ||
} | ||
|
||
case object Zero extends Nat | ||
case class Succ[N <: Nat](p: N) extends Nat | ||
|
||
transparent inline def toIntg(inline n: Nat): Int = | ||
inline n match { | ||
case Zero => 0 | ||
case Succ(p) => toIntg(p) + 1 | ||
} | ||
|
||
val j31 = toIntg(Zero.++.++.++ + Zero.++) | ||
} |