Skip to content

Add flags to Kernel to support known attributes of some operations #43994

Open
@rakudrama

Description

@rakudrama

It is complicated to store side-data for Kernel ASTs.
There are some side-data facts that could be supported directly as 'user' flags.

On MethodInvocation:

  • A flag to indicate that the parametric covariant checks will pass. The flag could be used by an invariance analysis, or set by code that is invariant by construction. Example: in the expansion of var a = [...x, b]; there is a call a.add(b) which has this property and should have the flag set.

  • A flag to indicate that an indexer's bound check will pass.

On procedures and / or invocations:

  • A flag to indicate that the returned value has no aliases. This is true of many factory constructors.

  • A flag to indicate that the receiver does not acquires an alias. Calling a.addAll(b) does not change the aliasing of a in the caller. This could be used in the [...x] expansion.

/cc @johnniwinther

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions