Skip to content

Commit 5cb6aa7

Browse files
authored
Rename private[chisel3] SourceInfo$Intf to SourceInfoIntf (#5033)
This works around an issue in IntelliJ around using the macro to materialize SourceInfo. Keep empty SourceInfo$Intf for binary compatibility.
1 parent f37085d commit 5cb6aa7

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

core/src/main/scala-2/chisel3/experimental/SourceInfoIntf.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ import scala.language.experimental.macros
1818
import scala.reflect.macros.blackbox.Context
1919
import chisel3.internal.sourceinfo.SourceInfoMacro
2020

21-
private[chisel3] trait SourceInfo$Intf { self: SourceInfo.type =>
21+
// Kept for binary compatibility, probably could be waived instead but just in case.
22+
private[chisel3] trait SourceInfo$Intf
23+
24+
// Technically this should be called "SourceInfo$Intf" but that causes issues for IntelliJ so we
25+
// omit the '$'.
26+
private[chisel3] trait SourceInfoIntf extends SourceInfo$Intf { self: SourceInfo.type =>
2227
implicit def materialize: SourceInfo = macro SourceInfoMacro.generate_source_info
2328
}

core/src/main/scala-3/chisel3/experimental/SourceInfoIntf.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
package chisel3.experimental
1616

17-
private[chisel3] trait SourceInfo$Intf { self: SourceInfo.type =>
17+
// Technically this should be called "SourceInfo$Intf" but that causes issues for IntelliJ so we
18+
// omit the '$'.
19+
private[chisel3] trait SourceInfoIntf { self: SourceInfo.type =>
1820
implicit def materialize: SourceInfo = UnlocatableSourceInfo
1921
}

core/src/main/scala/chisel3/experimental/SourceInfo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ case class SourceLine(filename: String, line: Int, col: Int) extends SourceInfo
5050
}
5151
}
5252

53-
object SourceInfo extends SourceInfo$Intf {
53+
object SourceInfo extends SourceInfoIntf {
5454

5555
/** Returns the best guess at the first stack frame that belongs to user code.
5656
*/

0 commit comments

Comments
 (0)