Skip to content

fix: bind unexported error sentinels as error#301

Merged
ivov merged 1 commit into
mainfrom
bind-unexported-error-sentinels
May 4, 2026
Merged

fix: bind unexported error sentinels as error#301
ivov merged 1 commit into
mainfrom
bind-unexported-error-sentinels

Conversation

@ivov
Copy link
Copy Markdown
Owner

@ivov ivov commented May 4, 2026

Bindgen now emits error for exported vars whose Go type is an unexported named type satisfying error. The most visible case is cmpopts.AnyError, whose underlying anyError is struct{} and previously surfaced as Lisette's unit type (), leaving the var unusable without a manual cast.

import "go:errors"
import "go:github.com/google/go-cmp/cmp"
import "go:github.com/google/go-cmp/cmp/cmpopts"

let err: error = errors.New("boom")
cmp.Equal(err, cmpopts.AnyError, cmpopts.EquateErrors()) // true

@ivov ivov merged commit b0fb981 into main May 4, 2026
11 checks passed
@ivov ivov mentioned this pull request May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Released in lisette-v0.1.26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant