Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

implicitly call .toString() (maybe) #41

@mmoskal

Description

@mmoskal

The concatenation operator (+) as well as the indexing operator need to convert arguments to string. This may involve calling user-defined .toString() method.

The plan:

  • add a flag to devs_activation saying it's an implicit toString frame
  • when .toString() needs to be called move back pc by one, copy any stack items, attach them to the activation frame for toString(), reset stack to zero
  • upon return from toString frame - restore stack, in the calling opcode skip stuff based on the toString flag somehow

Alternative - STMT2_PLUS - stack is always empty

Alternative currently preferred - don't call .toString() implicitly and have the compiler warn about .toString()

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestnon-mvpIssues that likely won't be fixed soon

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions