GROOVY-6961: fix wrong generics type extraction for extension methods by using the custom declared class instead of backing node
Fixed bug GROOVY-6778

The string "-d" is being used to escape dashes. Thus, converting all dashes to "-d" must be the first replacement that is done (it was) and converting them back must be the last (it wasn't). The bug resulted in the following erroneous conversion:

"-n" -> "-dn" -> "-n" -> "?"
Merge pull request #490 from fintelia/patch-1

GROOVY-6778: Allow "-n" in filenames and command line arguments
GROOVY-6836: If joint compilation is active *and* that @CompileStatic is used with @Immutable, metaclasses are mixed