79769272

Date: 2025-09-19 08:12:10
Score: 1
Natty:
Report link

I was looking how to call function/ class method and found this.

@eythort answered about functions, here is for method, where you need to define type.

If I understand question, issue is how to call

$a,$b = $C.test()

or

$a,$b = [C]::test()

I wrote this as

class C {
  static [System.Array] test () {
    return @('a','c'),'b'
  }
}

$a will be an array, and $b the letter 'b'

> $a
a
c
> $b
b
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @answered
  • Low reputation (0.5):
Posted by: mitjajez