Template Haskell regression: GHC erroneously thinks a type variable is also a kind

The following program compiles without issue on GHC 7.6.3 through GHC 7.10.3, but fails to compile on GHC 8.0.1 and GHC HEAD. (I added a CPP guard simply because the DataD constructor changed between 7.10 and 8.0.)

Change the type variable of T to some other letter, e.g., data T p or data T k1

Given that (3) is a successful workaround, I strongly suspect that GHC is confusing the type variable k (which gets ddump-spliced as k_avB) with the kind variable k (which gets ddump-spliced as k_avC) due to their common prefix k.