Skip to content

Conversation

ChrisDodd
Copy link
Contributor

@ChrisDodd ChrisDodd commented Jul 6, 2025

This change adds support for implicit reading and assigning to extern instances. If an extern type jas method marked @implicit, they can be used to implicitly read or write an extern instance via normal expressions or assignments

  • a method of the form @implicit T methodname() (a method with no arguments and non-void return type) allows an extern instance to be used as an rvalue (a use on the right side of an assignment or an operand to an operator, or in argument to a methodcall)
  • a method of the form @implicit void methodname(T) (a method with one argument and void return) allows an extern instance to be used as an lvalue (left operand of an assignment or out argument to a methodcall.)

This is an alternative to #5330 to allow for persistent data implemented as an extern

This PR is on top of #5338 and requires that change

@fruffy fruffy added the core Topics concerning the core segments of the compiler (frontend, midend, parser) label Jul 6, 2025
@ChrisDodd ChrisDodd force-pushed the cdodd-externimplicit branch from f548464 to 29c5476 Compare July 22, 2025 00:40
@ChrisDodd ChrisDodd force-pushed the cdodd-externimplicit branch from 29c5476 to 7fc42c2 Compare August 11, 2025 22:02
@ChrisDodd ChrisDodd force-pushed the cdodd-externimplicit branch 3 times, most recently from 3e1d4aa to 61ab5ab Compare October 3, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Topics concerning the core segments of the compiler (frontend, midend, parser)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants