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 22, 2025

fix: nighca/builder-experience#32
fix: goplus/builder#2012

  1. When processing the inner expr, panic occurs.
  2. The corresponding stmt does not call end.
  3. This lack of an end causes the code context to not be restored to the old code context.
  4. Ultimately, when the outer stmt processes the remaining expr, the code context is incorrectly verified, causing another panic.

Copilot AI review requested due to automatic review settings August 22, 2025 08:54
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 an issue where the type checker could return an unexpected error by implementing proper error handling and recovery mechanisms. The fix ensures that when type checking fails during statement compilation, the system can gracefully handle the error and continue processing.

Key changes:

  • Added an error handler parameter to the type checking infrastructure
  • Implemented deferred recovery blocks in statement compilation functions
  • Reorganized the order of cb.End() calls to use defer statements for proper cleanup

Reviewed Changes

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

File Description
x/typesutil/check_test.go Adds error handling infrastructure and test case to verify proper error handling during type checking
cl/stmt.go Implements deferred recovery blocks in statement compilation functions to handle panics gracefully

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

@xushiwei xushiwei merged commit 6d873be into goplus:main Aug 24, 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.

报错报的位置不对 type checker returned an unexpected error

3 participants