Permalink
Browse files

Rank 1 arrays need to be vectors types, not multidimensional types

  • Loading branch information...
1 parent 874f3c3 commit fa27a4fc8e6a7834fae02bda161376ab5301f13c Frank Laub committed Mar 3, 2010
Showing with 14 additions and 1 deletion.
  1. +5 −1 src/DotWeb.Hosting.Weaver/HostingWeaver.cs
  2. +9 −0 test/DotWeb.Weaver.Test.Script/MiscTest.cs
@@ -177,7 +177,11 @@ class ConstantNames
if (typeSpec is ArrayType) {
var arrayType = (ArrayType)typeSpec;
var elementProc = ResolveTypeReference(arrayType.ElementType, genericScope);
- var realType = elementProc.Type.MakeArrayType(arrayType.Rank);
+ Type realType;
+ if (arrayType.Rank == 1)
+ realType = elementProc.Type.MakeArrayType();
+ else
+ realType = elementProc.Type.MakeArrayType(arrayType.Rank);
var externalWrapper = new ExternalType(this, realType);
return externalWrapper;
}
@@ -81,4 +81,13 @@ class Misc_IndexerNameTest
Console.WriteLine(str[0]);
}
}
+
+ class Misc_BindToVarArgs
+ {
+ public Misc_BindToVarArgs() {
+ var str = "This is a string";
+ var parts = str.Split(' ');
+ Console.WriteLine(parts);
+ }
+ }
}

0 comments on commit fa27a4f

Please sign in to comment.