File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 5
5
6
6
// RUN: %target-typecheck-verify-swift -swift-version 5 -load-plugin-library %t/%target-library-name(MacroDefinition) %s -enable-experimental-feature ExpressionMacroDefaultArguments -enable-bare-slash-regex
7
7
8
- typealias Stringified < T> = ( T , String )
8
+ public typealias Stringified < T> = ( T , String )
9
+
10
+ // expected-note@+2{{macro 'stringify' is not '@usableFromInline' or public}}
9
11
@freestanding ( expression)
10
12
macro stringify< T> ( _ value: T ) -> Stringified < T > = #externalMacro(
11
13
module: " MacroDefinition " , type: " StringifyMacro "
@@ -53,3 +55,9 @@ func testIdentifier(notOkay: Stringified<String> = #stringify(myString)) {}
53
55
54
56
// expected-error@+1{{argument to macro used as default argument must be literal}}
55
57
func testString( interpolated: Stringified < String > = #stringify ( " Hello \( 0b10001 ) " ) ) { }
58
+
59
+ // expected-error@+1{{macro 'stringify' is internal and cannot be referenced from a default argument value}}
60
+ public func testAccess( internal: Stringified < Int > = #stringify ( 0 ) ) { }
61
+
62
+ // expected-error@+1{{default argument value of type '(Int, String)' cannot be converted to type 'Int'}}
63
+ func testReturn( wrongType: Int = #stringify ( 0 ) ) { }
You can’t perform that action at this time.
0 commit comments