Improve type inference and completions (#16963)

This commit is contained in:
MartinGC94 authored and GitHub committed 2022-06-13 10:04:35 -07:00
1 parent e1521117db
commit 4f6e574820
6 files changed
+188 -60

No files matched your search

@@ -554,22 +554,20 @@ try
}
}
Describe "Tab expansion in constrained language mode" -Tags 'Feature','RequireAdminOnWindows' {
Describe "Conversion in constrained language mode" -Tags 'Feature','RequireAdminOnWindows' {
It "Verifies that tab expansion cannot convert disallowed IntPtr type" {
It "Verifies that PowerShell cannot convert disallowed IntPtr type" {
try
{
$ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage"
$result = @(TabExpansion2 '(1234 -as [IntPtr]).' 20 | ForEach-Object CompletionMatches | Where-Object CompletionText -Match Pointer)
$result = 1234 -as [IntPtr]
$null -eq $result | Should -BeTrue
}
finally
{
Invoke-LanguageModeTestingSupportCmdlet -EnableFullLanguageMode
}
$result.Count | Should -Be 0
}
}