Kapiainen / SublimePapyrus

A Sublime Text 2 and 3 package for the Papyrus scripting language.
MIT License
47 stars 8 forks source link

Array.Length not recognized by linter #23

Closed akor79 closed 8 years ago

akor79 commented 8 years ago

The linter doesn't seem to recognize the length property of arrays.

Example: int[] myArray = new int[3] int len = myArray.Length

Error in line xxx: 'INT' does not have any properties, functions, nor events...

Kapiainen commented 8 years ago

After a bit of testing it turns out that this bug is caused by a check that is in place for bool, float, int, and string variables (arrays of other types e.g. Quest are not affected by this bug). The purpose of said check is to flag attempts to access properties of a bool/float/int/string variable as a semantic error. However, it did not take into account whether or not the bool/float/int/string variable was an array in which case the length property is accessible regardless of the variable type. It seems to have been easy to fix. I'll do a bit more testing tomorrow morning just to be sure and then I should be able to upload a new version.

Thanks for bringing this issue to my attention

Kapiainen commented 8 years ago

Fixed in version 2.5.0.