7

I updated my codebase to Go 1.18. It all looks great, but in a few places, I found the following issues.

defer func() {
    if e := recover() ; e!=nil {
        ...
    }
}()

Compilation is failing with:

Cannot convert 'nil' to type 'any'

The same code was working good with Go 1.17. Based on Go 1.18 Release notes, any is a built-in type of alias for interface{} (Generics)

What is going on?

blackgreen
  • 34,072
  • 23
  • 111
  • 129
Raghu
  • 722
  • 3
  • 8
  • 19

1 Answers1

12

The issue is with the IDE. IntelliJ Goland 2021.2.4

I can build the code from the command line and in the playground.

blackgreen
  • 34,072
  • 23
  • 111
  • 129
Raghu
  • 722
  • 3
  • 8
  • 19