Home Dashboard Directory Help
Search

OutputType attribute should detect output type error on strict mode by S.K. _


Status: 

Active


3
0
Sign in
to vote
Type: Suggestion
ID: 801907
Opened: 9/22/2013 11:01:34 PM
Access Restriction: Public
0
Workaround(s)
view

Description

Currently, outputtype attribute doesn't influence function's output-values.

But I expect it detect unexpected type error when a function outputs unexpected types --- in strict mode at least.


Set-StrictMode -Version 3

function aaa {
[OutputType([int])]
"String"
}

aaa
# unexpected type error
Details
Sign in to post a comment.
Sign in to post a workaround.