diff options
| author | Schuyler Eldridge | 2018-11-22 23:40:38 -0500 |
|---|---|---|
| committer | GitHub | 2018-11-22 23:40:38 -0500 |
| commit | 27afc3d8defd9e2a85d5e3d2f9d2b35310b9b775 (patch) | |
| tree | 8435ab570e88b60ca6af127e607794c64565bb9c /src/main/scala/firrtl/options/OptionsView.scala | |
| parent | 4a2211c1602b37a65b4e44c3b7ebe82e8bfeedc0 (diff) | |
| parent | 696bc256a90cc80bcb094aaeada8eea51a643ae0 (diff) | |
Merge pull request #945 from seldridge/add-phase
- Change firrtl.options API, add Phase
Diffstat (limited to 'src/main/scala/firrtl/options/OptionsView.scala')
| -rw-r--r-- | src/main/scala/firrtl/options/OptionsView.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/scala/firrtl/options/OptionsView.scala b/src/main/scala/firrtl/options/OptionsView.scala index dade5c56..aacd997e 100644 --- a/src/main/scala/firrtl/options/OptionsView.scala +++ b/src/main/scala/firrtl/options/OptionsView.scala @@ -12,7 +12,8 @@ trait OptionsView[T] { /** Convert an [[AnnotationSeq]] to some other type * @param options some annotations */ - def view(options: AnnotationSeq): Option[T] + def view(options: AnnotationSeq): T + } /** A shim to manage multiple "views" of an [[AnnotationSeq]] */ @@ -23,5 +24,6 @@ object Viewer { * @param optionsView a converter of options to the requested type * @tparam T the type to which the input [[AnnotationSeq]] should be viewed as */ - def view[T](options: AnnotationSeq)(implicit optionsView: OptionsView[T]): Option[T] = optionsView.view(options) + def view[T](options: AnnotationSeq)(implicit optionsView: OptionsView[T]): T = optionsView.view(options) + } |
