summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJiuyang Liu2021-01-20 20:05:50 +0000
committerGitHub2021-01-20 20:05:50 +0000
commit616256c35cb7de8fcd97df56af1986b747abe54d (patch)
tree02168858aec5bd464f08ae9bc4d148656d2a48bf /core
parent5f9328fa9e86248a3ed144ac1dabc05e3bb13b05 (diff)
remove 2.11 dedicated code. (#1744)
This PR revert #1480, but keep the test. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/chisel3/Aggregate.scala14
1 files changed, 1 insertions, 13 deletions
diff --git a/core/src/main/scala/chisel3/Aggregate.scala b/core/src/main/scala/chisel3/Aggregate.scala
index e45f5b46..403fcdba 100644
--- a/core/src/main/scala/chisel3/Aggregate.scala
+++ b/core/src/main/scala/chisel3/Aggregate.scala
@@ -834,18 +834,6 @@ abstract class Bundle(implicit compileOptions: CompileOptions) extends Record {
}
}
- val isAnonFunc = ".*\\$\\$anonfun\\$\\d+$".r
- // In Scala 2.11, anonymous functions were compiled to their own classes, while in Scala 2.12,
- // they are directly compiled into the enclosing classes. This meant that checking the enclosing
- // parent in 2.12 would work, but in 2.11 they wouldn't. This fix just looks for the first enclosing class
- // which is not an anonymous function.
- def getNonFuncClass(clz: Class[_]): Option[Class[_]] = {
- clz.getName match {
- case isAnonFunc() => getNonFuncClass(clz.getEnclosingClass)
- case _ => Some(clz)
- }
- }
-
val mirror = runtimeMirror(clazz.getClassLoader)
val classSymbolOption = try {
@@ -857,7 +845,7 @@ abstract class Bundle(implicit compileOptions: CompileOptions) extends Record {
val enclosingClassOption = (clazz.getEnclosingClass, classSymbolOption) match {
case (null, _) => None
case (_, Some(classSymbol)) if classSymbol.isStatic => None // allows support for members of companion objects
- case (parent, _) => getNonFuncClass(parent)
+ case (outerClass, _) => Some(outerClass)
}
// For compatibility with pre-3.1, where null is tried as an argument to the constructor.