Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessor throws exception when used inside another module #92

Open
alx9r opened this issue Mar 1, 2017 · 0 comments
Open

Accessor throws exception when used inside another module #92

alx9r opened this issue Mar 1, 2017 · 0 comments

Comments

@alx9r
Copy link
Owner

alx9r commented Mar 1, 2017

Repro

Invoking

New-Module {
    Import-Module ToolFoundations

    class c {
        hidden $_p = $(Accessor $this {
            get {
                "getter $($this._p)"
            }
            set {
                param ( $arg )
                $this._p = "setter $arg"
            }
        })
    }

    function New-C {[c]::new()}
}

$c = New-C

outputs

Accessor : Exception calling "InvokeWithContext" with "2" argument(s): "The 
term 'get' is not recognized as the name of a cmdlet, function, script file, 
or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again."
At line:5 char:24
+         hidden $_p = $(Accessor $this {
+                        ~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Accessor], MethodInvocationEx 
   ception
    + FullyQualifiedErrorId : CommandNotFoundException,Accessor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant