mavnn/FSharp.TypeProviders.StarterPack — pull request #9 by TIHan (2013-12-21 15:11:05+00:00)
Title: Fixed 'index out of bounds' on ProvidedConstructors containing invokable...

I encountered an "Index was outside the bounds of the array" error that prevented me from having invokable code for a ProvidedConstructor. Digging further into this, it's a bug in the type-provider source - and thankfully it's trivial. :)

In ProvidedConstructor's GetInvokeCodeInternal, the parameters that are being mapped to paramNames was not appending "[this]" when the constructor wasn't static. Looking at ProvidedMethod's GetInvokeCodeInternal, you can see the append code:

```FSharp
|> List.append (if this.IsStatic then [] else ["this"])
```

I just added that logic to the ProvidedConstructor's GetInvokeCodeInternal and formatted it the same way as the ProvidedMethod's GetInvokeCodeInternal.

Without this fix, I cannot use my type provider: https://gist.github.com/TIHan/8061090/e3878a23c2938645e386c33aa4d98dc0f95660c1