Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test case for type checking of array index

  • Loading branch information...
commit d202f57ae2b675aed13dab12ee94584ddc86118a 1 parent a94a1f2
@bamboo bamboo authored
View
4 src/UnityScript.Tests/ErrorMessagesTestFixture.Generated.boo
@@ -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")
View
13 tests/error-messages/invalid-array-index.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]);
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.