-
Notifications
You must be signed in to change notification settings - Fork 831
Closed
Closed
Copy link
Labels
Milestone
Description
Execute the code in fsi:
let collection () = [
yield "Hello"
"And this"
]
collection()
And observe the warning:
"And this"
----^^^^^^^^^^
stdin(3,5): warning FS3221: This expression returns a value of type 'string' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield'.
As a keen developer you will observe the error ID FS3221 and say I know #nowarn "FS3221" will fix this right smartly.
If you subject this smart idea to reality by executing code similar to:
#nowarn "FS3221"
let collection () = [
yield "Hello"
"And this"
]
collection()
Reality will reward you with this - quite surprising - error message:
stdin(7,1): warning FS0203: Invalid warning number 'FS3221'
After some time reading around you might decide to try:
#nowarn "3221"
let collection () = [
yield "Hello"
"And this"
]
collection()
Which will do what you originally wanted.
Let's make FS# work correctly, you know it makes sense.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done