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
Investigating how Lisette handles the built-in
Unknowntype and how Go bindings are generated so we can fix the naming conflict with discordgo. - Assistant
Implementing the fix: when resolving type names, prefer prelude types over value definitions that shadow them.
- Assistant
The main test had syntax issues; simplifying it to focus on typedef resolution.
- Assistant
Cleaning up redundant logic in the fix:
- Assistant
Fixed. When resolving type names, Lisette was picking up Go package values (like discordgo's
Unknownconstant) instead of the prelude's built-inUnknowntype.Root cause
In
resolve_type_with_arity, an unqualified name likeUnknownwas resolved vialookup_qualified_name, which finds any definition in the current module — including constants. Bindgen usesUnknownfor Go'sinterface{}/any, so when a package also exports a constant namedUnknown, type resolution picked the constant and triggeredresolve.value_in_type_position.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.