-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Related:
[Tomlyn.Model.TomlTable], from the Tomlyn package, is an example of a type that implements IDictionary`2, but not also its non-generic counterpart, IDictionary.
Seemingly, this prevents use of dot notation (property-access syntax via the member-access operator) to access the dictionary's entries.
# Determine the package's local installation location.
# If it isn't installed, install it first, in the current user's scope.
while (-not ($installDir = (Get-Package -ErrorAction Ignore -ProviderName NuGet Tomlyn).Source)) {
$null = Install-Package -Scope CurrentUser -ErrorAction Stop -ProviderName NuGet Tomlyn
}
# Load the package's assembly into the session.
Add-Type -ErrorAction Stop -LiteralPath (Join-Path $installDir '../lib/netstandard2.0/Tomlyn.dll')
# Define a sample TOML string to parse.
$tomlStr = @'
foo = "bar"
'@
# Parse the TOML string into an object mod)el (nested dictionaries).
$tomlTable = [Tomlyn.Toml]::ToModel($tomlStr)
# Output the global section's 'foo' value,
# first via an indexer, then via dot notation.
$tomlTable['foo'], $tomlTable.foo | ForEach-Object { "[$_]" }Expected behavior
[bar]
[bar]Actual behavior
[bar]
[]Error details
No response
Environment data
PowerShell Core 7.3.0-preview.3Visuals
No response
Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime