Reflect convertible types in type comparison #583
Labels
enhancement
New feature or request
textDocument/completion
textDocument/declaration
textDocument/definition
textDocument/hover
textDocument/references
textDocument/semanticTokens
Semantic syntax highlighting
Use-cases
Whenever we semantically highlight type-aware reference addresses, we compare types strictly (minus unknown/dynamic type which is handled as edge case).
Some types are however convertible to another, e.g. bool/number is convertible to string, as per https://www.terraform.io/docs/language/expressions/types.html#type-conversion
This leads e.g. to the following (valid config):
where
var.test
is not recognized as valid becauseaccess_token
is expected to be string.Proposal
hcl-lang
Implementation Notes
The
go-cty
convert
package contains the logic which is used by Terraform/HCL in this context:https://pkg.go.dev/github.com/zclconf/[email protected]/cty/convert
The text was updated successfully, but these errors were encountered: