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

Skip to content

Conversation

@lukaszcz
Copy link
Collaborator

@lukaszcz lukaszcz commented Aug 27, 2025

  • Introduces the type Reference Obj which represents a typed reference to an Object. This is just a typed wrapper over ObjectId, allowing the type-checking of references in user apps. The user-facing Program statements are adjusted to operate on typed references instead of raw object ids.

@lukaszcz lukaszcz self-assigned this Aug 27, 2025
@lukaszcz lukaszcz marked this pull request as ready for review August 27, 2025 13:02
Copy link
Contributor

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 pull request introduces typed object references to the Applib framework, replacing raw ObjectId usage with type-safe Reference wrappers. The main purpose is to provide compile-time type checking for object references in user applications.

  • Introduces a generic Reference type that wraps ObjectId with type information
  • Updates Program API to support typed references alongside existing ObjectId-based methods
  • Modifies the TwoCounter example to demonstrate usage of typed references

Reviewed Changes

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

File Description
Applib/Surface/Reference.lean Defines the new Reference type with type parameter and TypeRep instance
Applib/Surface/Program.lean Adds typed reference variants of program operations (destroy, call, fetch)
Applib/Surface.lean Imports the new Reference module
Apps/TwoCounter.lean Updates example to use Reference Counter instead of raw ObjectId

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

@lukaszcz lukaszcz merged commit d6c18e8 into main Aug 27, 2025
2 checks passed
@lukaszcz lukaszcz deleted the applib-references branch August 27, 2025 15:22
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.

3 participants