File tree Expand file tree Collapse file tree 2 files changed +20
-11
lines changed
validation-test/Sema/type_checker_perf/fast Expand file tree Collapse file tree 2 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -1348,27 +1348,20 @@ static void determineBestChoicesInContext(
13481348 return 0.3 ;
13491349 }
13501350
1351- auto &ctx = cs.getASTContext ();
1352-
13531351 // Check if the other side conforms to `ExpressibleByArrayLiteral`
13541352 // protocol (in some way). We want an overly optimistic result
13551353 // here to avoid under-favoring.
13561354 if (candidateType->isArray () &&
1357- checkConformanceWithoutContext (
1358- paramType,
1359- ctx.getProtocol (KnownProtocolKind::ExpressibleByArrayLiteral),
1360- /* allowMissing=*/ true ))
1355+ TypeChecker::conformsToKnownProtocol (
1356+ paramType, KnownProtocolKind::ExpressibleByArrayLiteral))
13611357 return 0.3 ;
13621358
13631359 // Check if the other side conforms to
13641360 // `ExpressibleByDictionaryLiteral` protocol (in some way).
13651361 // We want an overly optimistic result here to avoid under-favoring.
13661362 if (candidateType->isDictionary () &&
1367- checkConformanceWithoutContext (
1368- paramType,
1369- ctx.getProtocol (
1370- KnownProtocolKind::ExpressibleByDictionaryLiteral),
1371- /* allowMissing=*/ true ))
1363+ TypeChecker::conformsToKnownProtocol (
1364+ paramType, KnownProtocolKind::ExpressibleByDictionaryLiteral))
13721365 return 0.3 ;
13731366 }
13741367
Original file line number Diff line number Diff line change 1+ // RUN: %scale-test --begin 1 --end 15 --step 1 --select NumLeafScopes %s
2+ // REQUIRES: asserts,no_asan
3+
4+ struct MyIntValue: ExpressibleByArrayLiteral {
5+ init(arrayLiteral: Int...) {}
6+ }
7+
8+ func +(x: MyIntValue, y: MyIntValue) -> MyIntValue { [] }
9+ func +(x: MyIntValue, y: Int) -> MyIntValue { [] }
10+
11+ func test(y: Int) {
12+ %for i in range(0, N):
13+ [1] + y +
14+ %end
15+ [1] + y
16+ }
You can’t perform that action at this time.
0 commit comments