Re: Possible bug in AstBuilder Antlr4
It cannot. However the GString templates look like scripts, which is why I added an import in the first place. But then the builder fails with a ClassCastException. I would have expected it to fail with a better error message in this case, like "You're not allowed to use an import in a method body".