File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 2020
2121#include " swift/AST/SILLayout.h"
2222#include " swift/AST/Types.h"
23+ #include " swift/Basic/Assertions.h"
2324#include " swift/SIL/AbstractionPattern.h"
2425#include " swift/SIL/Lifetime.h"
2526#include " llvm/ADT/Hashing.h"
@@ -109,7 +110,7 @@ class SILType {
109110 SILType (CanType ty, SILValueCategory category)
110111 : value(ty.getPointer(), unsigned (category)) {
111112 if (!ty) return ;
112- assert (ty->isLegalSILType () &&
113+ ASSERT (ty->isLegalSILType () &&
113114 " constructing SILType with type that should have been "
114115 " eliminated by SIL lowering" );
115116 }
Original file line number Diff line number Diff line change @@ -420,6 +420,14 @@ class SILTypeSubstituter :
420420 substObjectType));
421421 }
422422
423+ // / MoveOnlyWrappedTypes need to have their inner types substituted
424+ // / by these rules.
425+ CanType visitSILMoveOnlyWrappedType (CanSILMoveOnlyWrappedType origType) {
426+ CanType origInnerType = origType->getInnerType ();
427+ CanType substInnerType = visit (origInnerType);
428+ return CanType (SILMoveOnlyWrappedType::get (substInnerType));
429+ }
430+
423431 // / Any other type would be a valid type in the AST. Just apply the
424432 // / substitution on the AST level and then lower that.
425433 CanType visitType (CanType origType) {
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-frontend -emit-sil -O %s
2+
3+ public struct Mutex < T> {
4+ public init ( _: T ) { }
5+ }
6+
7+ public struct Locked < T> {
8+ public let mutex : Mutex < T >
9+
10+ public init ( _ rawValue: consuming T ) {
11+ mutex = Mutex ( rawValue)
12+ }
13+ }
14+
15+ _ = Locked { }
You can’t perform that action at this time.
0 commit comments