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:
🔴 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]Root Cause
discordgodefines a constant named Unknown (e.g. Unknown Locale). Lisette also has a built-in type named Unknown used to represent opaque/untyped Go values in bindings. When the binding generator emits Unknown in a type position, the name resolves to the discordgo constant value instead of the Lisette type, triggering the error.Expected Behavior
Lisette's built-in Unknown type should take precedence in type positions, or the binding generator should qualify/disambiguate imported names that shadow built-in types.
Reproduction
Add github.com/bwmarrin/discordgo as a dependency and run lis run. The error appears immediately during binding resolution without any user-written code.
import "go:fmt" import "go:github.com/bwmarrin/discordgo" const TOKEN = "token" fn main() { let _discord = try { discordgo.New("Bot" + TOKEN)? } fmt.Println("Hello world!") } Assistant
There's already a "prelude_type_shadowing" test. Let's check it.
Assistant
Build succeeded. Now let's run against reproduction file.
Assistant
Now let's check the rest of the function still works with
qualified_nameandtybeing mutable variables used later (they're used by value, not by reference issue). Let's build.Assistant
Builds cleanly. Let's rerun the reproduction.
Assistant
Good, both changes restored. Now let's temporarily revert only the convert.rs fix (keep fakepkg) to confirm the error reproduces with the actual fix removed.
Assistant
Confirmed: reproduces the exact error from the issue. Now restore the fix.
Assistant
Fixed. Now let's clean up the temporary fakepkg additions from stdlib (they were only for testing/reproduction, not part of the real fix).
Assistant
Now let's rebuild to confirm clean state and view the final diff.
Assistant
Now let's run the full test suite in
tests/(spec/ui tests) to ensure nothing broke.Assistant
Good — baseline already has these 1576 failures (likely pre-existing environment issues, e.g. snapshot testing or go toolchain absence). Let's restore my change and confirm same failure count (no new failures introduced).
Assistant
Let's rerun the test suite now with go/gofmt available.
Assistant
Now let's rebuild and re-run the original discordgo-like reproduction from the issue description to fully confirm end-to-end.
Assistant
Downloaded successfully. Let's install it.
Assistant
Now let's set up a real project with discordgo dependency and try to reproduce the exact issue end-to-end.
Assistant
Excellent, this actually worked with network access. Let's now write the exact reproduction code from the issue and run it.
Assistant
This is the exact error from the issue reproduced 1:1. Now let's restore the fix and confirm it resolves this exact real-world case.
Assistant
Confirmed fully resolved with the real
discordgodependency. Let's run the complete repository test suite once more (with Go 1.25 now available) to be thorough, and clean up any artifacts.Assistant
Consistent failure. Let's check if this is pre-existing (unrelated to my change) by stashing.
Assistant
Let's clean up temporary test directories/files we created outside the repo.
Assistant
Now let's view the final diff once more for review.
Assistant
Formatting now clean. Let's run clippy to check for warnings.
Assistant
No clippy warnings. Let's rebuild the CLI binary once more and do a final sanity check with the general reproduction and the full test suite.
Assistant
Same single pre-existing (network/environment-related) failure confirmed earlier to be unrelated to my change. The fix is complete and verified.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.