diff options
| author | Jared Barocsi | 2021-10-05 12:33:23 -0700 |
|---|---|---|
| committer | GitHub | 2021-10-05 19:33:23 +0000 |
| commit | 110705eeace4f9165dc6377e55c86a599f37a465 (patch) | |
| tree | 4e6ed88311fd1ce08cebc0225868d2d103c6fae7 /core/src/main/scala/chisel3/StrongEnum.scala | |
| parent | ce15ad50a5c175db06c3bba5e3bf46b6c5466c47 (diff) | |
Deprecate auto-application of empty argument lists to parameterless functions (#2124)
* Migrate nullary funcs to parameterless versions
* Make deprecation message and dummy arguments clear and consistent
Co-authored-by: Megan Wachs <megan@sifive.com>
Diffstat (limited to 'core/src/main/scala/chisel3/StrongEnum.scala')
| -rw-r--r-- | core/src/main/scala/chisel3/StrongEnum.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/main/scala/chisel3/StrongEnum.scala b/core/src/main/scala/chisel3/StrongEnum.scala index b3d7cf7d..9ae4c889 100644 --- a/core/src/main/scala/chisel3/StrongEnum.scala +++ b/core/src/main/scala/chisel3/StrongEnum.scala @@ -246,7 +246,7 @@ abstract class EnumFactory { private val enumRecords = mutable.ArrayBuffer.empty[EnumRecord] private def enumNames = enumRecords.map(_.name).toSeq - private def enumValues = enumRecords.map(_.inst.litValue()).toSeq + private def enumValues = enumRecords.map(_.inst.litValue).toSeq private def enumInstances = enumRecords.map(_.inst).toSeq private[chisel3] val enumTypeName = getClass.getName.init @@ -265,7 +265,7 @@ abstract class EnumFactory { def all: Seq[Type] = enumInstances private[chisel3] def nameOfValue(id: BigInt): Option[String] = { - enumRecords.find(_.inst.litValue() == id).map(_.name) + enumRecords.find(_.inst.litValue == id).map(_.name) } protected def Value: Type = macro EnumMacros.ValImpl @@ -291,11 +291,11 @@ abstract class EnumFactory { if (id.litOption.isEmpty) { throwException(s"$enumTypeName defined with a non-literal type") } - if (id.litValue() < this.id) { + if (id.litValue < this.id) { throwException(s"Enums must be strictly increasing: $enumTypeName") } - this.id = id.litValue() + this.id = id.litValue do_Value(name) } |
