@@ -2793,6 +2793,17 @@ TypeConverter::getTypeLowering(AbstractionPattern origType,
2793
2793
}
2794
2794
2795
2795
namespace swift ::test {
2796
+ static FunctionTest PrintASTTypeLowering (
2797
+ " print_ast_type_lowering" , [](auto &function, auto &arguments, auto &test) {
2798
+ auto value = arguments.takeValue ();
2799
+ auto silTy = value->getType ();
2800
+ auto canTy = silTy.getRawASTType ();
2801
+ auto *ty = canTy.getPointer ();
2802
+ function.getModule ()
2803
+ .Types .getTypeLowering (AbstractionPattern (ty), ty, function)
2804
+ .print (llvm::outs ());
2805
+ });
2806
+
2796
2807
// Arguments:
2797
2808
// - value: whose type will be printed
2798
2809
// Dumps:
@@ -3034,6 +3045,7 @@ void TypeConverter::verifyTrivialLowering(const TypeLowering &lowering,
3034
3045
// unconditionally but in this particular instantiation is trivial
3035
3046
// (3) being a special type that's not worth forming a conformance for
3036
3047
// - ModuleType
3048
+ // - SILTokenType
3037
3049
// (4) being an unowned(unsafe) reference to a class/class-bound existential
3038
3050
// NOTE: ReferenceStorageType(C) does not conform HOWEVER the presence
3039
3051
// of an unowned(unsafe) field within an aggregate DOES NOT allow
@@ -3076,7 +3088,7 @@ void TypeConverter::verifyTrivialLowering(const TypeLowering &lowering,
3076
3088
3077
3089
// ModuleTypes are trivial but don't warrant being given a
3078
3090
// conformance to BitwiseCopyable (case (3)).
3079
- if (isa<ModuleType>(ty)) {
3091
+ if (isa<ModuleType, SILTokenType >(ty)) {
3080
3092
// These types should never appear within aggregates.
3081
3093
assert (isTopLevel && " aggregate containing marker type!?" );
3082
3094
// If they did, though, they would not justify the aggregate's
0 commit comments