Permalink
Browse files

test case for type checking of array index

  • Loading branch information...
bamboo committed May 4, 2012
1 parent a94a1f2 commit d202f57ae2b675aed13dab12ee94584ddc86118a
@@ -82,6 +82,10 @@ partial class ErrorMessagesTestFixture:
RunTestCase("tests/error-messages/interface-errors.js")
+ [Test] def invalid_array_index():
+ RunTestCase("tests/error-messages/invalid-array-index.js")
+
+
[Test] def invalid_attribute_sequence():
RunTestCase("tests/error-messages/invalid-attribute-sequence.js")
@@ -0,0 +1,13 @@
+/*
+invalid-array-index.js(11,25): BCE0022: Cannot convert 'UnityScript.Tests.CSharp.Vector3' to 'int'.
+*/
+import UnityScript.Tests.CSharp;
+
+var tiles : int[,];
+var v2 = Vector3(1, 1, 1);
+
+function Start () {
+ tiles = new int[5, 5];
+ print (tiles[0, v2]);
+}
+

0 comments on commit d202f57

Please sign in to comment.