Skip to content

When using multi-line string literal, formatting results in invalid code in 509.0.0 #652

Closed
@treastrain

Description

@treastrain

I'm using swift-format 509.0.0. If I prepare the following sample code and run swift-format format, it formats it into code that cannot be built.

This problem did not occur in swift-format 508.0.0. Is it a bug in swift-format 509.0.0?

import Foundation

@available(*, deprecated, renamed: "num", message: """
This is
multi-line
string
""")
func int() -> Int { 1 }

swift-format format -i Sources/main.swift
import Foundation

@available(
  *, deprecated, renamed: "num",
  message: """This is
  multi-line
  string"""
)
func int() -> Int { 1 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions