Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1// Checks that in Embedded Swift, we allow using stdlib types even when they
2// have declared availability to be higher than our macOS deployment target.
3
4// RUN: %target-typecheck-verify-swift -target arm64-apple-macos14 -enable-experimental-feature Embedded
5// RUN: %target-typecheck-verify-swift -target arm64-apple-macos15 -enable-experimental-feature Embedded
6
7// REQUIRES: swift_in_compiler
8// REQUIRES: swift_feature_Embedded
9// REQUIRES: OS=macosx
10
11func f(_: Span<Int>) { } // Span is @available(SwiftStdlib 6.1, *)
12func g(_: Int128) { } // Int128 is @available(SwiftStdlib 6.0, *)
13

After

1// Checks that in Embedded Swift, we allow using stdlib types even when they
2// have declared availability to be higher than our macOS deployment target.
3
4// RUN: %target-typecheck-verify-swift -target arm64-apple-macos14 -enable-experimental-feature Embedded
5// RUN: %target-typecheck-verify-swift -target arm64-apple-macos15 -enable-experimental-feature Embedded
6// RUN: %target-typecheck-verify-swift -target x86_64-apple-macos14 -enable-experimental-feature Embedded -target-min-inlining-version min
7
8// REQUIRES: swift_in_compiler
9// REQUIRES: swift_feature_Embedded
10// REQUIRES: OS=macosx
11
12public protocol P { }
13struct S: P { }
14public enum E: Error { }
15
16public func f(_: Span<Int>) { } // Span is @available(SwiftStdlib 6.1, *)
17public func g(_: Int128) { } // Int128 is @available(SwiftStdlib 6.0, *)
18public func opaqueReturn() -> some P { return S() }
19public func asyncFunc() async { }
20public actor Actor { }
21public func variadicGeneric<each T>(_: repeat each T) { }
22public func typedThrow() throws(E) { }
23public struct ValueGeneric<let N: Int> { }
24

Before

source_file
comment "// Checks that in Embedded Swift, we allow using stdlib type"...
comment "// have declared availability to be higher than our macOS de"...
comment "// RUN: %target-typecheck-verify-swift -target arm64-apple-m"...
comment "// RUN: %target-typecheck-verify-swift -target arm64-apple-m"...
comment "// REQUIRES: swift_in_compiler"
comment "// REQUIRES: swift_feature_Embedded"
comment "// REQUIRES: OS=macosx"
function_declaration
func "func"
simple_identifier "f"
( "("
parameter
simple_identifier "_"
: ":"
user_type
type_identifier "Span"
type_arguments
< "<"
user_type
type_identifier "Int"
> ">"
) ")"
function_body
{ "{"
} "}"
comment "// Span is @available(SwiftStdlib 6.1, *)"
function_declaration
func "func"
simple_identifier "g"
( "("
parameter
simple_identifier "_"
: ":"
user_type
type_identifier "Int128"
) ")"
function_body
{ "{"
} "}"
comment "// Int128 is @available(SwiftStdlib 6.0, *)"

After

source_file
comment "// Checks that in Embedded Swift, we allow using stdlib type"...
comment "// have declared availability to be higher than our macOS de"...
comment "// RUN: %target-typecheck-verify-swift -target arm64-apple-m"...
comment "// RUN: %target-typecheck-verify-swift -target arm64-apple-m"...
comment "// RUN: %target-typecheck-verify-swift -target x86_64-apple-"...
comment "// REQUIRES: swift_in_compiler"
comment "// REQUIRES: swift_feature_Embedded"
comment "// REQUIRES: OS=macosx"
protocol_declaration
modifiers
visibility_modifier
public "public"
protocol "protocol"
type_identifier "P"
protocol_body
{ "{"
} "}"
class_declaration
struct "struct"
type_identifier "S"
: ":"
inheritance_specifier
user_type
type_identifier "P"
class_body
{ "{"
} "}"
class_declaration
modifiers
visibility_modifier
public "public"
enum "enum"
type_identifier "E"
: ":"
inheritance_specifier
user_type
type_identifier "Error"
enum_class_body
{ "{"
} "}"
function_declaration
modifiers
visibility_modifier
public "public"
func "func"
simple_identifier "f"
( "("
parameter
simple_identifier "_"
: ":"
user_type
type_identifier "Span"
type_arguments
< "<"
user_type
type_identifier "Int"
> ">"
) ")"
function_body
{ "{"
} "}"
comment "// Span is @available(SwiftStdlib 6.1, *)"
function_declaration
modifiers
visibility_modifier
public "public"
func "func"
simple_identifier "g"
( "("
parameter
simple_identifier "_"
: ":"
user_type
type_identifier "Int128"
) ")"
function_body
{ "{"
} "}"
comment "// Int128 is @available(SwiftStdlib 6.0, *)"
function_declaration
modifiers
visibility_modifier
public "public"
func "func"
simple_identifier "opaqueReturn"
( "("
) ")"
-> "->"
opaque_type
some "some"
user_type
type_identifier "P"
function_body
{ "{"
statements
control_transfer_statement
return "return"
call_expression
simple_identifier "S"
call_suffix
value_arguments
( "("
) ")"
} "}"
function_declaration
modifiers
visibility_modifier
public "public"
func "func"
simple_identifier "asyncFunc"
( "("
) ")"
async "async"
function_body
{ "{"
} "}"
class_declaration
modifiers
visibility_modifier
public "public"
actor "actor"
type_identifier "Actor"
class_body
{ "{"
} "}"
function_declaration
modifiers
visibility_modifier
public "public"
func "func"
simple_identifier "variadicGeneric"
type_parameters
< "<"
type_parameter
type_parameter_pack
each "each"
user_type
type_identifier "T"
> ">"
( "("
parameter
simple_identifier "_"
: ":"
type_pack_expansion
repeat "repeat"
type_parameter_pack
each "each"
user_type
type_identifier "T"
) ")"
function_body
{ "{"
} "}"
function_declaration
modifiers
visibility_modifier
public "public"
func "func"
simple_identifier "typedThrow"
( "("
) ")"
throws_clause
( "("
user_type
type_identifier "E"
) ")"
function_body
{ "{"
} "}"
class_declaration
modifiers
visibility_modifier
public "public"
struct "struct"
type_identifier "ValueGeneric"
type_parameters
< "<"
type_parameter
type_identifier "let"
ERROR "N"
: ":"
user_type
type_identifier "Int"
> ">"
class_body
{ "{"
} "}"