Skip to content

IDL Problem Code 14 with alias colon-in-func

Want to disable me? Check out the configuration guide to learn more.

Warning

Using a colon for indexing should only happy when using brackets.

Legacy IDL code allowed for both, but modern usage of IDL should have brackets and not parentheses.

This identifies when we have a function call that contains the colon operator inside.

It indicates that you should likely be using brackets to index your arrays and not parentheses.

idl
!null = thing(1:42)
            ;^^^^^^^ Colon in function

To fix, swap out your parentheses with brackets:

idl
!null = thing[1:42]
            ;^^^^^^^ Yippee, no problem!

Licensed under MIT.