You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parsing: introduce @_preInverseGenericsExceptCopyable as an alias attribute
We need an alias since `@_preInverseGenerics(except: ...)` has custom parsing that older
compilers aren't designed to handle. Only simple decl attributes are parsed correctly by
older compilers, so this alias allows you to write this:
```
@_preInverseGenericsExceptCopyable
var x = 0
var x = 0
```
Which all helps with the introduction of Span<~Escapable>.
related to rdar://176395527
// DEMANGLED: (extension in test):test.MySpan< where A: ~Swift.Copyable>._count2.getter : Swift.Int
416
+
// CHECK: sil [transparent] [serialized] [ossa] @$s4test6MySpanVAARi_zrlE7_count2Sivg : $@convention(method) <T where T : ~Copyable, T : ~Escapable> (@guaranteed MySpan<T>) -> Int {
417
+
@_preInverseGenericsExceptCopyable
418
+
publicvar_count2:Int
419
+
409
420
// DEMANGLED: (extension in test):test.MySpan< where A: ~Swift.Copyable>._pointer.getter : Swift.UnsafeRawPointer?
410
421
// CHECK: sil [transparent] [serialized] [ossa] @$s4test6MySpanVAARi_zrlE8_pointerSVSgvg : $@convention(method) <T where T : ~Copyable, T : ~Escapable> (@guaranteed MySpan<T>) -> Optional<UnsafeRawPointer> {
// CHECK: sil [ossa] @$s4test6MySpanVAARi_zRi0_zrlE9extMethodyyF : $@convention(method) <T where T : ~Copyable, T : ~Escapable> (@guaranteed MySpan<T>) -> () {
// The shorthand alias also requires the experimental feature.
17
+
@_preInverseGenericsExceptCopyable // expected-error {{'@_preInverseGenerics' is an experimental feature; use '-enable-experimental-feature PreInverseGenericsExcept'}}
0 commit comments