[Rust] Get type of expression
- Linguagem predominante
- CodeQL
- Estrelas
- 10.1k
- Forks
- 2.1k
- Merge médio
- 2d 15h
- PRs com merge (30d)
- 141
Descrição
**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.
```ql
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?
Guia de contribuição
Direção de pesquisa
Start by reviewing the Rust CodeQL expression model and the existing Expr predicates, using getBase() and StringLiteralExpr from the example as the initial entry points. Confirm whether an internal type API or workaround exists; done means an expression type can be queried well enough to constrain the shown index-expression class.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- rust
- Domínio
- devtools, security
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100