Very similar to https://github.com/scalamacros/kepler/blob/2111260687ee5f8f46949a656fa734d548fb485b/src/reflect/scala/reflect/internal/Trees.scala#L1139