File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -1629,8 +1629,10 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
1629
1629
" EnumInst operand must be an object" );
1630
1630
SILType caseTy = UI->getType ().getEnumElementType (UI->getElement (),
1631
1631
F.getModule ());
1632
- require (caseTy == UI->getOperand ()->getType (),
1633
- " EnumInst operand type does not match type of case" );
1632
+ if (UI->getModule ().getStage () != SILStage::Lowered) {
1633
+ require (caseTy == UI->getOperand ()->getType (),
1634
+ " EnumInst operand type does not match type of case" );
1635
+ }
1634
1636
}
1635
1637
}
1636
1638
Original file line number Diff line number Diff line change
1
+ // Check that we don't crash when we verify after every pass.
2
+ // RUN: %empty-directory(%t)
3
+ //
4
+ // RUN: %target-swift-frontend %s -I %S/../stdlib/Inputs/Mirror/ -o %t/Mirror \
5
+ // RUN: -emit-ir -sil-verify-all -o /dev/null
6
+
7
+ class A : CustomReflectable {
8
+ var a : Int = 1
9
+ var customMirror : Mirror {
10
+ return Mirror ( self , children: [ " aye " : a] )
11
+ }
12
+ }
13
+ class X : A { }
14
+ class Y : X { }
15
+ class B : Y {
16
+ var b : UInt = 42
17
+ override var customMirror : Mirror {
18
+ return Mirror (
19
+ self ,
20
+ children: [ " bee " : b] ,
21
+ ancestorRepresentation: . customized( { super. customMirror } ) )
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments