R# 5.0 – inline method doesn’t understand ‘params’

Not really all that big a deal, but it hit me today, so I figured I’d do a quick little post+sshots and post the link in their forums.

So, start with a simple enough case:

image

Trying to inline that as-is doesn’t work with relatively obscure conflicts:

image

Now, this is caused by the no-args call, so just to get past that error and onto the next issue, we comment it out and then try to inline:

image

A couple of problems here:

  • The resulting code doesn’t compile, of course, since it’s trying to cast a string as an array (instead, it should have just created an inline array)
  • The multi-param calls lose data, since only the first param was kept around, the rest were thrown away

Adding in an intermediary call site changes things a little:

image

Inlining the inner (PrintAll) works fine since it’s inlining within a method that’s already got it passed as an array:

image

Inlining the outer fails, though, but different than our original case:

image

However, just like with the original, we can comment out the no-args version to get the inlining to work, with the same problems we saw in the original case (bad cast, loss of n-1 params)

image

Advertisements