-
Notifications
You must be signed in to change notification settings - Fork 245
Open
Description
There is a problem when trying to assign array by value to any variable after initialization. I prepared code sample to demonstrate my issue. To my knowledge every case should work exactly the same. What am I missing here?
#!/usr/bin/env bash
source "$( cd "${BASH_SOURCE[0]%/*}" && pwd )/lib/oo-bootstrap.sh"
import util/log
import util/class
class:MyIssue() {
public string someMessage
public array someMessageLines
MyIssue.someStuff() {
array someMessageLines="$(this someMessage toArray)"
$var:someMessageLines
if [[ $($var:someMessageLines length) != 0 ]]; then echo 'This stuff worked '; fi
}
MyIssue.someStufff() {
array someMessageLines
$var:someMessageLines="$(this someMessage toArray)"
$var:someMessageLines
if [[ $($var:someMessageLines length) != 0 ]]; then echo 'This stufff worked '; fi
}
MyIssue.someStuffff() {
this someMessageLines="$(this someMessage toArray)"
this someMessageLines
if [[ $(this someMessageLines length) != 0 ]]; then echo 'This stuffff worked '; fi
}
}
Type::Initialize MyIssue
MyIssue my
$var:my someMessage = 'automatic
error
handling
with
exceptions
'
$var:my someStuff
echo '----------------'
$var:my someStufff
echo '----------------'
$var:my someStuffffMetadata
Metadata
Assignees
Labels
No labels