Skip to content

Embedded Swift: Cannot convert String to Int #75730

Open
@michael-jan

Description

@michael-jan

Description

The following code gives "error: no exact matches in call to initializer" when compiled in Embedded Swift mode, but no error when compiled in Full Swift.

    _ = Int("42")

Reproduction

func f() {
    _ = Int("42")
}

Expected behavior

It compiles and properly parses the String into an Int.

Environment

Swift Development Snapshot 2024-08-03

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.embeddedEmbedded Swiftstandard libraryArea: Standard library umbrellaswift 6.1unexpected errorBug: Unexpected error

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions