VladRassokhin / intellij-hcl

HCL language support for IntelliJ platform based IDEs
Apache License 2.0
244 stars 48 forks source link

Variable value type 'object' doesn't match default type 'map(string)' #362

Closed solarmosaic-kflorence closed 2 years ago

solarmosaic-kflorence commented 2 years ago

Prerequisites

Installation details

IDE version (Help->About->Copy to Clipboard)

IntelliJ IDEA 2021.2 (Ultimate Edition)
Build #IU-212.4746.92, built on July 27, 2021
Licensed to <REDACTED>
Subscription is active until December 26, 2021.
Runtime version: 11.0.11+9-b1504.13 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: ParNew, ConcurrentMarkSweep
Memory: 4029M
Cores: 8
Registry: scala.erase.compiler.process.jdk.once=false
Non-Bundled Plugins: org.intellij.plugins.hcl (0.7.14), mobi.hsz.idea.gitignore (4.2.0), name.kropp.intellij.makefile (212.4746.52), org.toml.lang (0.2.152.4026-212), org.jetbrains.plugins.hocon (2021.1.0), intellij.prettierJS (212.4746.57), Pythonid (212.4746.96), org.jetbrains.plugins.go (212.4746.92), org.intellij.scala (2021.2.15), pro.bashsupport (2.0.4.212)
Kotlin: 212-1.5.10-release-IJ4746.92

intellij-hcl plugin version -> 0.7.14 Terraform version -> Terraform v1.0.7 on darwin_amd64

Terraform Configuration Files

variable "provided_policies" {
  default     = {}
  description = "A mapping of policy reference name to policy ARN for policies which are defined outside of this module."
  type        = map(string)
}

Expected Behavior

The editor should not display any errors for the above HCL.

Actual Behavior

The editor highlights the {} as an error with the hover text "Variable value type 'object' doesn't match default type 'map(string)'".

Screen Shot 2021-11-05 at 5 13 44 PM

Steps to Reproduce

  1. Create a variable that has a map(string) type
  2. Set default = {}
VladRassokhin commented 2 years ago

Fixed in upcoming update (0.7.15)