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
@@ -642,6 +642,33 @@ public class PublicClassUser: ProtocolFromDirect {
642
642
publicvarpublicField:StructFromDirect
643
643
// expected-error @-1 {{cannot use struct 'StructFromDirect' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'directs' has been imported as implementation-only}}
644
644
645
+
privatevarprivateField:StructFromDirect
646
+
privatevara:ExposedLayoutPublic
647
+
privatevaraa:ExposedLayoutInternal
648
+
privatevarb:ExposedLayoutPrivate
649
+
privatevarc:HiddenLayout
650
+
651
+
privatevard:ExposedEnumPublic
652
+
privatevare:ExposedEnumPrivate
653
+
privatevarf:HiddenEnum
654
+
655
+
privatevarg:ExposedProtocolPublic
656
+
privatevarh:ExposedProtocolInternal
657
+
privatevari:ExposedProtocolPrivate
658
+
privatevarj:HiddenProtocol
659
+
660
+
@export(interface)
661
+
privatefunc privateFunc(h:HiddenLayout){}
662
+
}
663
+
664
+
openclassOpenClassUser:ProtocolFromDirect{
665
+
// expected-error @-1 {{cannot use protocol 'ProtocolFromDirect' in a public or '@usableFromInline' conformance; 'directs' has been imported as implementation-only}}
666
+
667
+
publicinit(){fatalError()}
668
+
669
+
publicvarpublicField:StructFromDirect
670
+
// expected-error @-1 {{cannot use struct 'StructFromDirect' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'directs' has been imported as implementation-only}}
671
+
645
672
privatevarprivateField:StructFromDirect
646
673
// expected-opt-in-error @-1 {{cannot use struct 'StructFromDirect' in a property declaration member of a type not marked '@_implementationOnly'; 'directs' has been imported as implementation-only}}
647
674
privatevara:ExposedLayoutPublic
@@ -665,32 +692,67 @@ public class PublicClassUser: ProtocolFromDirect {
665
692
privatefunc privateFunc(h:HiddenLayout){}
666
693
}
667
694
695
+
@_fixed_layout
696
+
publicclassFixedClassUser:ProtocolFromDirect{
697
+
// expected-error @-1 {{cannot use protocol 'ProtocolFromDirect' in a public or '@usableFromInline' conformance; 'directs' has been imported as implementation-only}}
698
+
699
+
publicinit(){fatalError()}
700
+
701
+
publicvarpublicField:StructFromDirect
702
+
// expected-error @-1 {{cannot use struct 'StructFromDirect' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'directs' has been imported as implementation-only}}
703
+
704
+
privatevarprivateField:StructFromDirect
705
+
// expected-error @-1 {{cannot use struct 'StructFromDirect' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'directs' has been imported as implementation-only}}
706
+
privatevara:ExposedLayoutPublic
707
+
privatevaraa:ExposedLayoutInternal
708
+
// expected-error @-1 {{type referenced from a stored property in a '@frozen' struct must be '@usableFromInline' or public}}
709
+
privatevarb:ExposedLayoutPrivate
710
+
// expected-error @-1 {{type referenced from a stored property in a '@frozen' struct must be '@usableFromInline' or public}}
711
+
privatevarc:HiddenLayout
712
+
// expected-opt-in-error @-1 {{cannot use struct 'HiddenLayout' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'HiddenLayout' is marked '@_implementationOnly'}}
713
+
// expected-error @-2 {{type referenced from a stored property in a '@frozen' struct must be '@usableFromInline' or public}}
714
+
715
+
privatevard:ExposedEnumPublic
716
+
privatevare:ExposedEnumPrivate
717
+
// expected-error @-1 {{type referenced from a stored property in a '@frozen' struct must be '@usableFromInline' or public}}
718
+
privatevarf:HiddenEnum
719
+
// expected-opt-in-error @-1 {{cannot use enum 'HiddenEnum' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'HiddenEnum' is marked '@_implementationOnly'}}
720
+
// expected-error @-2 {{type referenced from a stored property in a '@frozen' struct must be '@usableFromInline' or public}}
721
+
722
+
privatevarg:ExposedProtocolPublic
723
+
privatevarh:ExposedProtocolInternal
724
+
// expected-error @-1 {{type referenced from a stored property in a '@frozen' struct must be '@usableFromInline' or public}}
725
+
privatevari:ExposedProtocolPrivate
726
+
// expected-error @-1 {{type referenced from a stored property in a '@frozen' struct must be '@usableFromInline' or public}}
727
+
privatevarj:HiddenProtocol
728
+
// expected-opt-in-error @-1 {{cannot use protocol 'HiddenProtocol' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'HiddenProtocol' is marked '@_implementationOnly'}}
729
+
// expected-error @-2 {{type referenced from a stored property in a '@frozen' struct must be '@usableFromInline' or public}}
// expected-opt-in-error @-1 {{cannot use protocol 'ProtocolFromDirect' in a public or '@usableFromInline' conformance; 'directs' has been imported as implementation-only}}
670
737
671
738
publicinit(){fatalError()}
672
739
673
740
publicvarpublicField:StructFromDirect
674
-
// expected-opt-in-error @-1 {{cannot use struct 'StructFromDirect' in a property declaration member of a type not marked '@_implementationOnly'; 'directs' has been imported as implementation-only}}
675
741
privatevarprivateField:StructFromDirect
676
-
// expected-opt-in-error @-1 {{cannot use struct 'StructFromDirect' in a property declaration member of a type not marked '@_implementationOnly'; 'directs' has been imported as implementation-only}}
677
742
678
743
privatevara:ExposedLayoutPublic
679
744
privatevaraa:ExposedLayoutInternal
680
745
privatevarb:ExposedLayoutPrivate
681
746
privatevarc:HiddenLayout
682
-
// expected-opt-in-error @-1 {{cannot use struct 'HiddenLayout' in a property declaration member of a type not marked '@_implementationOnly'; 'HiddenLayout' is marked '@_implementationOnly'}}
683
747
684
748
privatevard:ExposedEnumPublic
685
749
privatevare:ExposedEnumPrivate
686
750
privatevarf:HiddenEnum
687
-
// expected-opt-in-error @-1 {{cannot use enum 'HiddenEnum' in a property declaration member of a type not marked '@_implementationOnly'; 'HiddenEnum' is marked '@_implementationOnly'}}
688
751
689
752
privatevarg:ExposedProtocolPublic
690
753
privatevarh:ExposedProtocolInternal
691
754
privatevari:ExposedProtocolPrivate
692
755
privatevarj:HiddenProtocol
693
-
// expected-opt-in-error @-1 {{cannot use protocol 'HiddenProtocol' in a property declaration member of a type not marked '@_implementationOnly'; 'HiddenProtocol' is marked '@_implementationOnly'}}
694
756
695
757
privatefunc privateFunc(h:HiddenLayout){} // expected-embedded-opt-in-error {{struct 'HiddenLayout' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenLayout' is marked '@_implementationOnly'}}
696
758
}
@@ -701,26 +763,21 @@ private class PrivateClassUser: ProtocolFromDirect {
701
763
publicinit(){fatalError()}
702
764
703
765
publicvarpublicField:StructFromDirect
704
-
// expected-opt-in-error @-1 {{cannot use struct 'StructFromDirect' in a property declaration member of a type not marked '@_implementationOnly'; 'directs' has been imported as implementation-only}}
705
766
privatevarprivateField:StructFromDirect
706
-
// expected-opt-in-error @-1 {{cannot use struct 'StructFromDirect' in a property declaration member of a type not marked '@_implementationOnly'; 'directs' has been imported as implementation-only}}
707
767
708
768
privatevara:ExposedLayoutPublic
709
769
privatevaraa:ExposedLayoutInternal
710
770
privatevarb:ExposedLayoutPrivate
711
771
privatevarc:HiddenLayout
712
-
// expected-opt-in-error @-1 {{cannot use struct 'HiddenLayout' in a property declaration member of a type not marked '@_implementationOnly'; 'HiddenLayout' is marked '@_implementationOnly'}}
713
772
714
773
privatevard:ExposedEnumPublic
715
774
privatevare:ExposedEnumPrivate
716
775
privatevarf:HiddenEnum
717
-
// expected-opt-in-error @-1 {{cannot use enum 'HiddenEnum' in a property declaration member of a type not marked '@_implementationOnly'; 'HiddenEnum' is marked '@_implementationOnly'}}
718
776
719
777
privatevarg:ExposedProtocolPublic
720
778
privatevarh:ExposedProtocolInternal
721
779
privatevari:ExposedProtocolPrivate
722
780
privatevarj:HiddenProtocol
723
-
// expected-opt-in-error @-1 {{cannot use protocol 'HiddenProtocol' in a property declaration member of a type not marked '@_implementationOnly'; 'HiddenProtocol' is marked '@_implementationOnly'}}
724
781
725
782
privatefunc privateFunc(h:HiddenLayout){} // expected-embedded-opt-in-error {{struct 'HiddenLayout' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenLayout' is marked '@_implementationOnly'}}
0 commit comments