Unknown constant in go dependencies conflicts with Lisette's built-in Unknown type The…
- User
Unknown constant in go dependencies conflicts with Lisette's built-in Unknown type The discordgo package defines a constant named
Unknown(used for unrecognized types/events), which conflicts with Lisette's built-in Unknown type. When Lisette generates bindings for discordgo, any function signature that uses Unknown as a type parameter is misinterpreted — the compiler sees the discordgo value Unknown in a type position, causing a resolve.value_in_type_position error.Error output:
code🔴 Value in type position ╭─[go:github.com_bwmarrin_discordgo.d.lis:4693:46] 4692 │ /// Logger can be used to replace the standard logging for discordgo 4693 │ pub var Logger: fn(int, int, string, VarArgs<Unknown>) -> () · ───┬─── · ╰── expected type, found value 4694 │ ╰──── help: Only a type is allowed here · code: [resolve.value_in_type_position] 🔴 Value in type position ╭─[go:github.com_bwmarrin_discordgo.d.lis:4695:21] 4694 │ 4695 │ pub var Marshal: fn(Unknown) -> Result<Slice<byte>, error> · ───┬─── · ╰── expected type, found value 4696 │ ╰──── help: Only a type is allowed here · code: [resolve.value_in_type_position] 🔴 Value in type position ╭─[go:github.com_bwmarrin_discordgo.d.lis:4697:36] 4696 │ 4697 │ pub var Unmarshal: fn(Slice<byte>, Unknown) -> Result<(), error> · ───┬─── · ╰── expected type, found value 4698 │ ╰──── help: Only a type is allowed here · code: [resolve.value_in_type_position] - Assistant
I’ll trace binding generation and name resolution, then add a focused regression test and run the relevant suite.
- Assistant
The failure is in type-position resolution, not Go binding emission: an unqualified package value wins before the prelude type because both have arity zero. I’m checking existing shadowing semantics so the fix preserves legitimate user-defined type lookup.
- Assistant
The resolver now falls back to a matching prelude type when an unqualified package definition is a value. The regression fixture mirrors all three failing discordgo shapes (
VarArgs<Unknown>, inputUnknown, and result/error signatures); its targeted test is compiling now. - Assistant
The regression and all 320 inference type tests pass, including the existing “value in type position” diagnostics. I’m doing the crate-level checks and final diff review now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.