Skip to content

[Rust] Get type of expressionΒ #20501

@intrigus-lgtm

Description

@intrigus-lgtm

Description of the issue

How do I get the type of an expression in Rust?

For example, I want to constrain this to only accesses on string-like expressions.

private class IndexExprOnNonConstantString extends IndexExpr {
  IndexExprOnNonConstantString() { not this.getBase() instanceof StringLiteralExpr }
}

Actual: No getType predicate on expr.
Expected: Predicate to get type of expr.

When will support be added for an - in my understanding - very basic feature?
Or is there a workaround/internal API?

Metadata

Metadata

Assignees

No one assigned

    Labels

    RustPull requests that update Rust codequestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions