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
Now let me write a reproduction test:
- Assistant
Now I'll add the reproduction test:
- Assistant
Reproduced. Now the fix in
resolve_type_with_arity: - Assistant
Test passes. Now run the full suite to check for regressions:
- Assistant
This failure looks environmental (gofmt formatting). Let me check baseline before my change:
- Assistant
The snapshot test runs left
.snap.newartifacts from the pre-existing environmental failures — cleaning those up: - Assistant
Now run the targeted test groups relevant to this change (the infer and ui error suites, which don't depend on the Go toolchain):
- Assistant
All pass. Let me verify the emit/build failures are truly environmental (missing gofmt):
- Assistant
Now check formatting and full clippy:
- Assistant
Done. Final counts: 3574 passed / 1576 failed vs. baseline 3572 / 1576 — the two extra passes are the new tests, and the 1576 failures are pre-existing on the unmodified checkout (emit/build snapshot tests that require the Go toolchain, which isn't installed here:
go: command not found).Summary
Root cause: In
crates/semantics/src/checker/registration/convert.rs,resolve_type_with_arityresolved a type-position name through the general name lookup, which finds module-local definitions first. When a Go binding exports a named (like discordgo's locale constant), that value shadowed the prelude's built-in type inside the binding's own file, and then flagged it with .
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.