Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@go-wyvern
Copy link
Member

@go-wyvern go-wyvern commented Aug 26, 2025

types.Error does not have End, but has go116end. If the language server needs to use end, it must use reflection, which has poor performance. Alternatively, it can use the unsafe package, which is also not very safe. Therefore, xgo is considering providing its own Error.

Copilot AI review requested due to automatic review settings August 26, 2025 07:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes type error handling in the xgo types utility by introducing a custom Error type that mimics the standard Go types.Error interface. The change ensures consistent error handling between Go and xgo type checking by providing proper error conversion functions.

  • Introduces a new Error type with position information and error formatting
  • Updates error conversion functions to use the new Error type instead of types.Error
  • Adds error handling wrapper for Go type checker to convert errors to the new format

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
x/typesutil/gopinfo.go Adds new Error type definition with position tracking and error formatting
x/typesutil/check.go Updates error handling to use new Error type and adds Go error conversion

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@xushiwei xushiwei merged commit c8a52d8 into goplus:main Aug 26, 2025
23 checks passed
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.

2 participants