JetBrains/kotlin — pull request #454 by Stebalien (2014-04-21 15:35:39+00:00)
Title: Create function from usage

Note: This is a WIP for-comment pull request (not a for-merge).

The first commit fixes a small bug. The second commit converts CreateFunctionFromUsageFix from Java to Kotlin to avoid growing the Java codebase. The final commit actually adds the create function from usage functionality:

It can create functions from:
* Normal function calls.
* Binary operators.
* Infix function calls.
* Prefix/postfix operators.

Currently, it can't:
* Guess type parameters.
* Properly guess vararg types.

Additionally, I don't yet have any test-cases.

I'm uploading this so that I can get feedback on the Java to Kotlin conversion, get help finding the correct vararg type, and get feedback on the structure of `createUnresolvedFunctionFromUsageFactory` (should I use an injector to break up UNRESOLVED_REFERENCE into smaller diagnostics?)

(yes I know that some of the code from commit 3 is a little messy).