ISSUE DESCRIPTION Unknown constant in go dependencies conflicts with Lisette's built-in…
- User
ISSUE DESCRIPTION
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 start by exploring the repository structure and locating how Lisette handles the built-in
Unknowntype and Go binding generation. - Assistant
There's already collision-handling infrastructure; I'll dig into how
Unknownis emitted and whether import collisions are already handled. - Assistant
rg is not available, let me use grep instead.
- Assistant
Found a reserved-names list including
Unknownin the emitter — I'll inspect how naming collisions are handled there. - Assistant
Let me look at import collision handling and also how names are resolved in the semantics crate.
- Assistant
There's a reserved-keywords list and a predeclared-shadowing pass — both look like the right place to fix the collision.
- Assistant
Next I'll check prelude shadowing and how name resolution treats the built-in
Unknown. - Assistant
Inspecting type-name resolution around
value_in_type_positionnext. - Assistant
Let me look at resolve_type_name and classify_non_type_name more carefully.
- Assistant
Let me look at resolve_type_with_arity and classify_non_type_name and lookup_qualified_name completely.
- Assistant
Checking how
store.get_typetreats values, and whether bindgen already renames symbols that clash with built-ins. - Assistant
Let me look at get_type implementation and how definitions are stored - values vs types.
- Assistant
Let me look at how Unknown is defined in the prelude and also check git history for related fixes.
- Assistant
Let me look at the bindgen more carefully for how names are emitted, and whether there's handling when a type name might conflict. Also look at how Unknown type itself is defined.
- Assistant
Let me look at the prelude definition for Unknown.
- Assistant
I'll check how Go binding modules import the prelude and whether there are related tests.
- Assistant
I'll implement the type-position fix so a local value can't shadow the prelude type, and check related tests first.
- Assistant
I need to check how type aliases are classified —
classify_non_type_namemight be treating them incorrectly. - Assistant
Implementing the fix: when a value shadows a name in type position, fall back to the prelude type if one exists.
- Assistant
The edit landed in the wrong file — I'll revert that and apply the change to
convert.rsinstead. - Assistant
Also need
qualified_nameandtyto be mutable for the fallback assignment. - Assistant
Verifying the change and trying to reproduce the issue next.
- Assistant
I'll set up a minimal reproduction with discordgo and try building Lisette.
- Assistant
Go isn't installed — checking how the project expects it and installing if needed.
- Assistant
Installing Go 1.25.10 so we can reproduce the binding build.
- Assistant
Creating a reproduction project and building Lisette.
- Assistant
I need a lisette.toml and src structure. Also building lisette will take a while.
- Assistant
Build succeeded — running the reproduction next.
- Assistant
Need to add the dependency first.
- Assistant
Need to fix project name.
- Assistant
Need to set GOPATH
- Assistant
Good, dependency added. Now run lis run -with our fix it might already workme. Let me also check if we can reproduce without the fix first by temporarily reverting... Actually let's just run with the ...
- Assistant
Confirming it fails without the fix so we know we really addressed the bug.
- Assistant
Restoring the fix and re-verifying.
- Assistant
Checking edge cases with a temporary script and running related unit tests:
- Assistant
There's a naming convention requirement. Also the path for run is different. Let me cdprocessen to edge1. AlsoGoing consts can maybe use #[allow(...)] or just check as check vs run燬...
- Assistant
vars need type annotations. Let me check how vars work.
- Assistant
Verifying the discordgo
Unknownconstant still resolves in value position. - Assistant
Let me just reuse the repro project.
- Assistant
Value position works (prints "unknown" locale), type position works.
- Assistant
Non-prelude values still error correctly. Next I'll run the related semantics unit tests.
- Assistant
Unit tests passed. Running the type-resolution suite next:
- Assistant
The filter didn't match. Let me find relevant tests.
- Assistant
There's a test for Go types that share prelude names — I'll make sure we don't break that.
- Assistant
Running a broader slice of infer/resolve tests for regressions:
- Assistant
All 1276 infer tests passed. Reviewing the final diff, then cleaning up.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.