Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-8466] Cannot cast to [String: AnyObject] on Linux #3651

Closed
swift-ci opened this issue Aug 6, 2018 · 5 comments
Closed

[SR-8466] Cannot cast to [String: AnyObject] on Linux #3651

swift-ci opened this issue Aug 6, 2018 · 5 comments

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Aug 6, 2018

Previous ID SR-8466
Radar None
Original Reporter rafiki270 (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Ubuntu 16.04 running in Docker

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: b1b531f52e9da43821c7abf76e0cae71

Issue Description:

Reading below plist using PropertyListSerialization succeeds on mac, not on linux

let plist = try PropertyListSerialization.propertyList(from: plistData, options: [], format: &format) as? [String: AnyObject]

Following succeeds on both platforms

let plist = try PropertyListSerialization.propertyList(from: plistData, options: [], format: &format) as? [String: Any]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDisplayName</key>
    <string>iDeviant</string>
    <key>CFBundleName</key>
    <string>iDeviant</string>
    <key>DTXcode</key>
    <string>0501</string>
    <key>DTSDKName</key>
    <string>iphoneos7.0</string>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>CFBundleIcons~ipad</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>AppIcon29x29</string>
                <string>AppIcon40x40</string>
                <string>AppIcon60x60</string>
                <string>AppIcon76x76</string>
            </array>
        </dict>
    </dict>
    <key>DTSDKBuild</key>
    <string>11B508</string>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>BuildMachineOSBuild</key>
    <string>13A603</string>
    <key>DTPlatformName</key>
    <string>iphoneos</string>
    <key>CFBundleShortVersionString</key>
    <string>4.0</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleSupportedPlatforms</key>
    <array>
        <string>iPhoneOS</string>
    </array>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>DTCompiler</key>
    <string>com.apple.compilers.llvm.clang.1_0</string>
    <key>CFBundleExecutable</key>
    <string>iDeviant</string>
    <key>UILaunchImages</key>
    <array>
        <dict>
            <key>UILaunchImageOrientation</key>
            <string>Portrait</string>
            <key>UILaunchImageName</key>
            <string>LaunchImage-700-568h</string>
            <key>UILaunchImageSize</key>
            <string>{320, 568}</string>
            <key>UILaunchImageMinimumOSVersion</key>
            <string>7.0</string>
        </dict>
    </array>
    <key>CFBundleResourceSpecification</key>
    <string>ResourceRules.plist</string>
    <key>MinimumOSVersion</key>
    <string>7.0</string>
    <key>UIDeviceFamily</key>
    <array>
        <integer>1</integer>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>DTXcodeBuild</key>
    <string>5A2053</string>
    <key>CFBundleIdentifier</key>
    <string>com.fuerteint.iDeviant</string>
    <key>UIAppFonts</key>
    <array>
        <string>FontAwesome.ttf</string>
    </array>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>DTPlatformVersion</key>
    <string>7.0</string>
    <key>CFBundleIcons</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>AppIcon29x29</string>
                <string>AppIcon40x40</string>
                <string>AppIcon60x60</string>
            </array>
        </dict>
    </dict>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>DTPlatformBuild</key>
    <string>11B508</string>
</dict>
</plist>
@belkadan
Copy link

belkadan commented Aug 6, 2018

What version of Swift are you using, Ondrej?

@millenomi, does this sound familiar?

@swift-ci
Copy link
Contributor Author

swift-ci commented Aug 6, 2018

Comment by Ondrej Rafaj (JIRA)

@belkadan 4.1

@belkadan
Copy link

belkadan commented Aug 6, 2018

Thanks!

@millenomi
Copy link
Contributor

This kind of cast is only supported in Swift 4.2.

@spevans
Copy link
Collaborator

spevans commented Feb 24, 2020

Tested OK on linux with swift 4.2

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants