File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1214,10 +1214,7 @@ Optional<Type> DefaultArgumentTypeRequest::getCachedResult() const {
1214
1214
if (!defaultInfo)
1215
1215
return None;
1216
1216
1217
- if (!defaultInfo->InitContextAndIsTypeChecked .getInt ())
1218
- return None;
1219
-
1220
- return defaultInfo->ExprType ;
1217
+ return defaultInfo->ExprType ? defaultInfo->ExprType : Optional<Type>();
1221
1218
}
1222
1219
1223
1220
void DefaultArgumentTypeRequest::cacheResult (Type type) const {
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
- // RUN: %target-swift-frontend-emit-module -emit-module-path %t/InferViaDefaults.swiftmodule -module-name InferViaDefaults %S/Inputs/type_inference_via_defaults_other_module.swift
3
- // RUN: %target-swift-frontend -module-name main -typecheck -verify -I %t %s %S/Inputs/type_inference_via_defaults_other_module.swift
2
+ // RUN: %target-build-swift -parse-as-library -emit-library -emit-module-path %t/InferViaDefaults.swiftmodule -module-name InferViaDefaults %S/Inputs/type_inference_via_defaults_other_module.swift -o %t/%target-library-name(InferViaDefaults)
3
+ // RUN: %target-swift-frontend -typecheck -verify -lInferViaDefaults -module-name main -I %t -L %t %s
4
+
5
+ import InferViaDefaults
4
6
5
7
func testInferFromResult< T> ( _: T = 42 ) -> T { fatalError ( ) } // Ok
6
8
@@ -136,8 +138,8 @@ func main() {
136
138
testMultiple ( a: 0.0 , b: " a " ) // Ok
137
139
138
140
// From a different module
139
- with_defaults ( ) // Ok
140
- with_defaults ( " " ) // Ok
141
+ InferViaDefaults . with_defaults ( ) // Ok
142
+ InferViaDefaults . with_defaults ( " " ) // Ok
141
143
142
144
_ = S ( ) [ ] // Ok
143
145
_ = S ( ) [ B ( ) ] // Ok
You can’t perform that action at this time.
0 commit comments