Friday, August 3, 2012

Self Note: Type Provider parameters


in the type provider static parameter, if you do:


let name = parameterValues.[1] :?> string;
let name2 = parameterValues.[2] :?> string;
let nameXXX = [| name; name2 |]


and use the NameXXX it works, but


let name = parameterValues.[1] :?> string;
let name2 = parameterValues.[2] :?> string;
let nameXXX = [| parameterValues.[1] :?> string; parameterValues.[2] :?> string |]


does not work and the error message confusing too. The error message says it does not support constant type string[]. It is pretty bad, but you can only get it work using the variable.

[Important] fixed in the recent check in and need latest type provider template.

No comments: