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
Found it — a Go-based bindgen tool. Let's inspect it.
Assistant
Now let's build the project to check compilation.
Assistant
Compiles fine. Now let's write a reproduction test to verify the fix resolves the exact scenario described.
Assistant
This gives me everything I need to write a temporary reproduction test.
Assistant
Now let's add a temporary test to reproduce the issue (will remove later, per instructions not to add persistent tests but ok to use temporary script).
Assistant
Now let's confirm this test actually fails without the fix (revert fix temporarily and test).
Assistant
Confirmed: the fix resolves the issue. Now let's clean up the debug print and remove the temporary test.
Assistant
Good, the fix is clean. Now revert the temporary test file changes.
Assistant
Now let's run the full test suite to ensure nothing is broken.
Assistant
Good — same failure count (1576) without my fix too, confirming these are pre-existing failures unrelated to my change (likely environment/snapshot related). Let's restore my fix and inspect a couple of these failures to be sure.
Assistant
Good, clean now. Let's confirm
gotoolchain missing is indeed the reason (unrelated environment issue), and run tests that don't depend on gofmt (e.g., infer tests only) to make sure those pass cleanly.Assistant
Now let's run cargo clippy on the semantics crate to check for any lints.
Assistant
No clippy warnings. Let's do a final full review of the diff and run the entire test suite once more for sanity (only checking count matches baseline).
Assistant
Matches the baseline exactly (3572 passed, 1576 failed — same as without the fix, confirming these failures are pre-existing environment issues, e.g., missing
go/gofmtbinary affecting snapshot formatting, unrelated to this change).Assistant
Clean diff, only the fix remains. Let's go through the checklist once more.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.