Note that the problem only surfaces _at the interactive prompt_, whether or not PSReadLine is loaded.
In a _script_ / script block, an error occurs, as expected.
This is a regression from v6.2.3 / WinPS.
Submit _at the prompt_:
'foo' -is [string
'foo' -as [string
A statement-terminating error with message:
Missing ] at end of attribute or type literal.
Both commands fail quietly, and $? even contains $true.
PowerShell Core 7.0.0-rc.1
Present in preview6 too, so something happened somewhere before that. 馃
I can not repo with latest build.
It works fine in 6.2.3 so it's definitely a regression 7.
Works well in 7.0 Preview1/Preview4.
It's a bug with the concise error view. The exception is still in $Error and if you retrieve it the formatting is blank. @iSazonov if it doesn't repro with the latest build, it was probably fixed with #11415.
@mklement0 Can you confirm with nightly build that the issue was fixed?
Thanks for diagnosing, @SeeminglyScience.
Indeed, @iSazonov, the problem has been fixed in the latest daily build.
Most helpful comment
It's a bug with the concise error view. The exception is still in
$Errorand if you retrieve it the formatting is blank. @iSazonov if it doesn't repro with the latest build, it was probably fixed with #11415.