File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed
validation-test/compiler_crashers_2_fixed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 501fa43c4d2713f6d20a4e9047b781d40eaab91a
2
+ refs/heads/master: cf379beb9df5e9470fb416ebf0eb580e51699320
3
3
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
4
4
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
5
5
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
Original file line number Diff line number Diff line change @@ -501,6 +501,11 @@ static bool canSynthesizeRawRepresentable(DerivedConformance &derived) {
501
501
// - the enum elements all have the same type
502
502
// - they all match the enum type
503
503
for (auto elt : enumDecl->getAllElements ()) {
504
+ // We cannot synthesize raw representable conformance for an enum with
505
+ // cases that have a payload.
506
+ if (elt->hasAssociatedValues ())
507
+ return false ;
508
+
504
509
tc.validateDecl (elt);
505
510
if (elt->isInvalid ()) {
506
511
return false ;
Original file line number Diff line number Diff line change
1
+ // RUN: not %target-swift-frontend -typecheck %s
2
+
3
+ // Just make sure we don't crash.
4
+
5
+ enum Crash : String {
6
+ case foo
7
+ case bar( String )
8
+
9
+ static let shared = Crash ( )
10
+ }
11
+
12
+ extension Crash {
13
+ init ( ) { self = . foo }
14
+ }
You can’t perform that action at this time.
0 commit comments