In Boo, how do I specify an array parameter?

In Boo, let's say I override a method that accepts a parameter that accepts string[] urls. Type inference for some reason does not match the base class, so I need to explicitly specify the type of the parameter.

class MyClass: MyBase
  override method(urls as Array[of (string)])
    dostuff()

This turns out to be the wrong Boo syntax. What is the correct way to indicate that I am overriding a method that takes an array parameter?

I usually prefer to expect IEnumerable, but I override another base class that is part of Rhino.DSL.

Edited to add: It turns out that my problem was only tangent to the syntax for declaring an array ... my real problem was two different versions of the Boo assembly referenced in my project.

+3
source share
1 answer

The brackets around the type are an array of this type:

class MyClass : MyBase
  override def method(urls as (string)):
    dostuff()
+3
source

Source: https://habr.com/ru/post/1712049/


All Articles