chipsalliance / chipsalliance/chisel

Not-Great Error Message for things both @instantiable and IsLookupable (maybe?)

Open
#2,309 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
4.8k
Forks
658
Avg merge
18h 59m
Merged PRs (30d)
14

Description

**Type of issue**: bug report | feature request

**Impact**: API modification

**Development Phase**: request
**Other information**

**If the current behavior is a bug, please provide the steps to reproduce the problem:**

Scastie that shows what a User should do: https://scastie.scala-lang.org/U7Ho6Rf1TyOMOiN5I7amzA
Scastie that shows what a user might do instead and be flummoxed by the error: https://scastie.scala-lang.org/M1PwkJvlTUiqGrQDpVX00g

**What is the current behavior?**

Not shown in the scastie, but in my build environment I was getting the `@public is only legal within a class marked @instantiable and only on vals of type Data, BaseModule, IsInstantiable, IsLookupable, or Instance[_], or in an Iterable or Option`

**What is the expected behavior?**

Well actually scastie gives a very nice error:
```
ambiguous implicit values:
both method lookupIsInstantiable in object Lookupable of type [B <: chisel3.experimental.hierarchy.IsInstantiable](implicit sourceInfo: chisel3.internal.sourceinfo.SourceInfo, compileOptions: chisel3.CompileOptions): chisel3.experimental.hierarchy.Lookupable[B]{type C = chisel3.experimental.hierarchy.Instance[B]}
and method lookupIsLookupable in object Lookupable of type [B <: chisel3.experimental.hierarchy.IsLookupable](implicit sourceInfo: chisel3.internal.sourceinfo.SourceInfo, compileOptions: chisel3.CompileOptions): chisel3.experimental.hierarchy.Lookupable.SimpleLookupable[B]
match expected type chisel3.experimental.hierarchy.Lookupable[Playground.FancyParams]
```

**Please tell us about your environment:**

**What is the use case for changing the behavior?**

Maybe it just works? I will add a test outside of scastie

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.