Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase: [ConstraintSystem] Ability to treat key path literal syntax as function type (Root) -> Value. #23435

Closed

Conversation

beccadax
Copy link
Contributor

Rebase of #19448 with an important bug fix. The original PR did not have a rule that would cause the solver to prefer KeyPath solutions to function solutions, making them ambiguous.

@beccadax
Copy link
Contributor Author

@swift-ci please smoke test

@beccadax
Copy link
Contributor Author

@swift-ci please build toolchain

@beccadax
Copy link
Contributor Author

@swift-ci please test source compatibility

@swift-ci
Copy link
Contributor

Linux Toolchain (Ubuntu 16.04)
Download Toolchain
Git Sha - 324d61690b6b540bb07866c448fc774353452284

Install command
tar zxf swift-PR-23435-169-ubuntu16.04.tar.gz
More info

lib/Sema/CSRanking.cpp Outdated Show resolved Hide resolved
@swift-ci
Copy link
Contributor

macOS Toolchain
Download Toolchain
Git Sha - 324d61690b6b540bb07866c448fc774353452284

Install command
tar -zxf swift-PR-23435-224-osx.tar.gz --directory ~/

@beccadax beccadax force-pushed the keypath_form_closure-squash branch from 324d616 to bba37e7 Compare March 20, 2019 21:07
@beccadax
Copy link
Contributor Author

@swift-ci please test compiler performance

1 similar comment
@beccadax
Copy link
Contributor Author

@swift-ci please test compiler performance

@swift-ci
Copy link
Contributor

Summary for master full

Unexpected test results, excluded stats for Deferred, Tagged, ProcedureKit, Wordy, CoreStore

Regressions found (see below)

Debug-batch

debug-batch brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 26,966,683,617,856 27,010,291,172,268 43,607,554,412 0.16%
LLVM.NumLLVMBytesOutput 967,619,178 967,626,836 7,658 0.0%
time.swift-driver.wall 2543.3s 2554.6s 11.3s 0.44%

debug-batch detailed

Regressed (2)
name old new delta delta_pct
Driver.NumDriverPipePolls 161,535 164,552 3,017 1.87% ⛔
Driver.NumDriverPipeReads 178,452 180,929 2,477 1.39% ⛔
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (97)
name old new delta delta_pct
AST.NumASTBytesAllocated 65,899,440,823 66,111,124,819 211,683,996 0.32%
AST.NumDecls 80,388 80,388 0 0.0%
AST.NumDependencies 204,311 204,306 -5 -0.0%
AST.NumImportedExternalDefinitions 1,084,910 1,084,910 0 0.0%
AST.NumInfixOperators 30,900 30,900 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 243,405 243,405 0 0.0%
AST.NumLocalTypeDecls 108 108 0 0.0%
AST.NumObjCMethods 9,687 9,687 0 0.0%
AST.NumPostfixOperators 18 18 0 0.0%
AST.NumPrecedenceGroups 14,446 14,446 0 0.0%
AST.NumPrefixOperators 70 70 0 0.0%
AST.NumReferencedDynamicNames 91 91 0 0.0%
AST.NumReferencedMemberNames 3,491,615 3,491,615 0 0.0%
AST.NumReferencedTopLevelNames 269,687 269,687 0 0.0%
AST.NumSourceBuffers 330,950 330,950 0 0.0%
AST.NumSourceLines 2,419,104 2,419,104 0 0.0%
AST.NumSourceLinesPerSecond 2,211,275 2,212,702 1,427 0.06%
AST.NumTotalClangImportedEntities 4,106,783 4,108,397 1,614 0.04%
AST.NumUsedConformances 225,744 225,744 0 0.0%
Driver.ChildrenMaxRSS 105,666,396,160 105,706,971,136 40,574,976 0.04%
Driver.DriverDepCascadingDynamic 0 0 0 0.0%
Driver.DriverDepCascadingExternal 0 0 0 0.0%
Driver.DriverDepCascadingMember 0 0 0 0.0%
Driver.DriverDepCascadingNominal 0 0 0 0.0%
Driver.DriverDepCascadingTopLevel 0 0 0 0.0%
Driver.DriverDepDynamic 0 0 0 0.0%
Driver.DriverDepExternal 0 0 0 0.0%
Driver.DriverDepMember 0 0 0 0.0%
Driver.DriverDepNominal 0 0 0 0.0%
Driver.DriverDepTopLevel 0 0 0 0.0%
Driver.NumDriverJobsRun 16,141 16,141 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.MaxMallocUsage 683,776,812,944 684,673,844,096 897,031,152 0.13%
Frontend.NumInstructionsExecuted 26,966,683,617,856 27,010,291,172,268 43,607,554,412 0.16%
Frontend.NumProcessFailures 0 0 0 0.0%
IRModule.NumIRAliases 104,647 104,647 0 0.0%
IRModule.NumIRBasicBlocks 3,833,318 3,833,318 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 1,798,333 1,798,333 0 0.0%
IRModule.NumIRGlobals 1,852,352 1,852,352 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 47,087,345 47,087,345 0 0.0%
IRModule.NumIRNamedMetaData 78,122 78,122 0 0.0%
IRModule.NumIRValueSymbols 3,292,242 3,292,242 0 0.0%
LLVM.NumLLVMBytesOutput 967,619,178 967,626,836 7,658 0.0%
Parse.NumFunctionsParsed 141,858 141,858 0 0.0%
Parse.NumIterableDeclContextParsed 1,000,666 1,000,666 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 931,200 931,200 0 0.0%
SILModule.NumSILGenGlobalVariables 37,118 37,118 0 0.0%
SILModule.NumSILGenVtables 10,668 10,668 0 0.0%
SILModule.NumSILGenWitnessTables 39,057 39,057 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 1,316,981 1,316,981 0 0.0%
SILModule.NumSILOptGlobalVariables 37,865 37,865 0 0.0%
SILModule.NumSILOptVtables 17,156 17,156 0 0.0%
SILModule.NumSILOptWitnessTables 85,971 85,971 0 0.0%
Sema.AccessLevelRequest 2,321,133 2,322,116 983 0.04%
Sema.DefaultAndMaxAccessLevelRequest 54,321 54,327 6 0.01%
Sema.DefaultTypeRequest 316,331 316,339 8 0.0%
Sema.EnumRawTypeRequest 16,934 16,934 0 0.0%
Sema.ExtendedNominalRequest 3,699,750 3,699,741 -9 -0.0%
Sema.InheritedDeclsReferencedRequest 4,267,110 4,264,956 -2,154 -0.05%
Sema.InheritedTypeRequest 528,124 528,097 -27 -0.01%
Sema.IsDynamicRequest 1,820,028 1,820,028 0 0.0%
Sema.IsObjCRequest 1,554,758 1,555,154 396 0.03%
Sema.MangleLocalTypeDeclRequest 216 216 0 0.0%
Sema.NamedLazyMemberLoadFailureCount 18,844 18,833 -11 -0.06%
Sema.NamedLazyMemberLoadSuccessCount 17,317,501 17,314,350 -3,151 -0.02%
Sema.NominalTypeLookupDirectCount 28,933,496 28,942,177 8,681 0.03%
Sema.NumConformancesDeserialized 6,468,534 6,473,598 5,064 0.08%
Sema.NumConstraintScopes 14,498,771 14,500,907 2,136 0.01%
Sema.NumConstraintsConsideredForEdgeContraction 36,811,975 36,812,740 765 0.0%
Sema.NumDeclsDeserialized 47,495,408 47,544,685 49,277 0.1%
Sema.NumDeclsFinalized 1,634,523 1,634,523 0 0.0%
Sema.NumDeclsTypechecked 890,758 890,758 0 0.0%
Sema.NumDeclsValidated 1,934,344 1,934,359 15 0.0%
Sema.NumFunctionsTypechecked 942,937 942,937 0 0.0%
Sema.NumGenericSignatureBuilders 1,134,960 1,135,451 491 0.04%
Sema.NumLazyGenericEnvironments 9,549,697 9,558,672 8,975 0.09%
Sema.NumLazyGenericEnvironmentsLoaded 194,734 194,718 -16 -0.01%
Sema.NumLazyIterableDeclContexts 6,646,584 6,646,424 -160 -0.0%
Sema.NumLeafScopes 9,514,898 9,516,658 1,760 0.02%
Sema.NumTypesDeserialized 15,971,840 15,979,726 7,886 0.05%
Sema.NumTypesValidated 1,310,208 1,310,227 19 0.0%
Sema.NumUnloadedLazyIterableDeclContexts 4,379,304 4,375,928 -3,376 -0.08%
Sema.OverriddenDeclsRequest 7,391,444 7,422,169 30,725 0.42%
Sema.RequirementRequest 62,139 62,142 3 0.0%
Sema.SelfBoundsFromWhereClauseRequest 6,205,584 6,203,246 -2,338 -0.04%
Sema.SetterAccessLevelRequest 136,606 136,606 0 0.0%
Sema.SuperclassDeclRequest 66,883 66,874 -9 -0.01%
Sema.SuperclassTypeRequest 30,680 30,680 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 29,873 29,879 6 0.02%
Sema.USRGenerationRequest 12,361,837 12,417,416 55,579 0.45%
Sema.UnderlyingTypeDeclsReferencedRequest 145,436 145,561 125 0.09%

Release

release brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 25,464,829,935,633 25,611,937,422,561 147,107,486,928 0.58%
LLVM.NumLLVMBytesOutput 783,337,254 785,597,968 2,260,714 0.29%
time.swift-driver.wall 4568.1s 4592.8s 24.7s 0.54%

release detailed

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
name old new delta delta_pct
AST.NumImportedExternalDefinitions 214,074 214,665 591 0.28%
AST.NumLoadedModules 16,202 16,334 132 0.81%
AST.NumTotalClangImportedEntities 727,586 729,870 2,284 0.31%
AST.NumUsedConformances 225,651 226,707 1,056 0.47%
IRModule.NumIRBasicBlocks 3,216,630 3,233,913 17,283 0.54%
IRModule.NumIRFunctions 1,484,805 1,492,297 7,492 0.5%
IRModule.NumIRGlobals 1,623,143 1,630,037 6,894 0.42%
IRModule.NumIRInsts 29,347,830 29,474,150 126,320 0.43%
IRModule.NumIRValueSymbols 2,895,964 2,909,647 13,683 0.47%
LLVM.NumLLVMBytesOutput 783,337,254 785,597,968 2,260,714 0.29%
SILModule.NumSILGenFunctions 646,087 649,899 3,812 0.59%
SILModule.NumSILOptFunctions 878,222 883,552 5,330 0.61%
Sema.NumConformancesDeserialized 2,193,700 2,207,769 14,069 0.64%
Sema.NumConstraintScopes 12,818,020 12,860,620 42,600 0.33%
Sema.NumDeclsDeserialized 5,915,175 5,959,238 44,063 0.74%
Sema.NumDeclsValidated 1,026,506 1,031,871 5,365 0.52%
Sema.NumFunctionsTypechecked 424,211 426,107 1,896 0.45%
Sema.NumGenericSignatureBuilders 187,855 188,939 1,084 0.58%
Sema.NumLazyGenericEnvironments 1,222,918 1,232,035 9,117 0.75%
Sema.NumLazyGenericEnvironmentsLoaded 20,832 20,965 133 0.64%
Sema.NumLazyIterableDeclContexts 752,846 758,183 5,337 0.71%
Sema.NumTypesDeserialized 3,133,240 3,155,332 22,092 0.71%
Sema.NumTypesValidated 610,226 613,443 3,217 0.53%

@beccadax
Copy link
Contributor Author

@swift-ci please test source compatibility

@beccadax
Copy link
Contributor Author

Going to rerun the performance test to see if the small regression holds up.

@beccadax
Copy link
Contributor Author

@swift-ci please test compiler performance

@swift-ci
Copy link
Contributor

Summary for master full

Unexpected test results, excluded stats for CoreStore, Tagged, ProcedureKit, Wordy, Deferred

Regressions found (see below)

Debug-batch

debug-batch brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 24,732,681,159,048 24,686,209,846,757 -46,471,312,291 -0.19%
LLVM.NumLLVMBytesOutput 968,071,348 968,073,252 1,904 0.0%
time.swift-driver.wall 2373.0s 2371.5s -1.5s -0.06%

debug-batch detailed

Regressed (2)
name old new delta delta_pct
Driver.NumDriverPipePolls 167,682 170,878 3,196 1.91% ⛔
Driver.NumDriverPipeReads 179,419 182,762 3,343 1.86% ⛔
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (97)
name old new delta delta_pct
AST.NumASTBytesAllocated 58,825,999,014 58,791,515,264 -34,483,750 -0.06%
AST.NumDecls 80,388 80,388 0 0.0%
AST.NumDependencies 159,722 159,726 4 0.0%
AST.NumImportedExternalDefinitions 912,378 912,378 0 0.0%
AST.NumInfixOperators 30,900 30,900 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 194,875 194,875 0 0.0%
AST.NumLocalTypeDecls 108 108 0 0.0%
AST.NumObjCMethods 9,687 9,687 0 0.0%
AST.NumPostfixOperators 18 18 0 0.0%
AST.NumPrecedenceGroups 14,446 14,446 0 0.0%
AST.NumPrefixOperators 70 70 0 0.0%
AST.NumReferencedDynamicNames 91 91 0 0.0%
AST.NumReferencedMemberNames 3,491,646 3,491,646 0 0.0%
AST.NumReferencedTopLevelNames 269,687 269,687 0 0.0%
AST.NumSourceBuffers 233,560 233,560 0 0.0%
AST.NumSourceLines 2,419,126 2,419,126 0 0.0%
AST.NumSourceLinesPerSecond 2,188,005 2,188,678 673 0.03%
AST.NumTotalClangImportedEntities 3,554,867 3,548,908 -5,959 -0.17%
AST.NumUsedConformances 225,749 225,749 0 0.0%
Driver.ChildrenMaxRSS 105,880,829,952 105,764,292,608 -116,537,344 -0.11%
Driver.DriverDepCascadingDynamic 0 0 0 0.0%
Driver.DriverDepCascadingExternal 0 0 0 0.0%
Driver.DriverDepCascadingMember 0 0 0 0.0%
Driver.DriverDepCascadingNominal 0 0 0 0.0%
Driver.DriverDepCascadingTopLevel 0 0 0 0.0%
Driver.DriverDepDynamic 0 0 0 0.0%
Driver.DriverDepExternal 0 0 0 0.0%
Driver.DriverDepMember 0 0 0 0.0%
Driver.DriverDepNominal 0 0 0 0.0%
Driver.DriverDepTopLevel 0 0 0 0.0%
Driver.NumDriverJobsRun 16,141 16,141 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.MaxMallocUsage 576,529,441,744 575,746,829,320 -782,612,424 -0.14%
Frontend.NumInstructionsExecuted 24,732,681,159,048 24,686,209,846,757 -46,471,312,291 -0.19%
Frontend.NumProcessFailures 0 0 0 0.0%
IRModule.NumIRAliases 104,647 104,647 0 0.0%
IRModule.NumIRBasicBlocks 3,833,328 3,833,328 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 1,798,333 1,798,333 0 0.0%
IRModule.NumIRGlobals 1,852,360 1,852,360 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 47,087,587 47,087,587 0 0.0%
IRModule.NumIRNamedMetaData 78,122 78,122 0 0.0%
IRModule.NumIRValueSymbols 3,292,248 3,292,248 0 0.0%
LLVM.NumLLVMBytesOutput 968,071,348 968,073,252 1,904 0.0%
Parse.NumFunctionsParsed 141,858 141,858 0 0.0%
Parse.NumIterableDeclContextParsed 705,938 705,938 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 931,200 931,200 0 0.0%
SILModule.NumSILGenGlobalVariables 37,118 37,118 0 0.0%
SILModule.NumSILGenVtables 10,668 10,668 0 0.0%
SILModule.NumSILGenWitnessTables 39,057 39,057 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 1,316,981 1,316,981 0 0.0%
SILModule.NumSILOptGlobalVariables 37,865 37,865 0 0.0%
SILModule.NumSILOptVtables 17,156 17,156 0 0.0%
SILModule.NumSILOptWitnessTables 85,971 85,971 0 0.0%
Sema.AccessLevelRequest 2,151,402 2,151,062 -340 -0.02%
Sema.DefaultAndMaxAccessLevelRequest 49,438 49,438 0 0.0%
Sema.DefaultTypeRequest 313,235 313,243 8 0.0%
Sema.EnumRawTypeRequest 15,028 15,028 0 0.0%
Sema.ExtendedNominalRequest 3,145,762 3,142,509 -3,253 -0.1%
Sema.InheritedDeclsReferencedRequest 3,829,113 3,817,814 -11,299 -0.3%
Sema.InheritedTypeRequest 564,490 563,957 -533 -0.09%
Sema.IsDynamicRequest 1,669,620 1,669,620 0 0.0%
Sema.IsObjCRequest 1,423,820 1,423,844 24 0.0%
Sema.MangleLocalTypeDeclRequest 216 216 0 0.0%
Sema.NamedLazyMemberLoadFailureCount 16,824 16,804 -20 -0.12%
Sema.NamedLazyMemberLoadSuccessCount 16,307,613 16,304,232 -3,381 -0.02%
Sema.NominalTypeLookupDirectCount 27,113,746 27,099,220 -14,526 -0.05%
Sema.NumConformancesDeserialized 6,036,014 6,021,423 -14,591 -0.24%
Sema.NumConstraintScopes 14,255,301 14,254,193 -1,108 -0.01%
Sema.NumConstraintsConsideredForEdgeContraction 36,698,758 36,698,715 -43 -0.0%
Sema.NumDeclsDeserialized 42,821,584 42,710,904 -110,680 -0.26%
Sema.NumDeclsFinalized 1,489,997 1,489,997 0 0.0%
Sema.NumDeclsTypechecked 890,986 890,986 0 0.0%
Sema.NumDeclsValidated 1,803,544 1,803,544 0 0.0%
Sema.NumFunctionsTypechecked 842,319 842,319 0 0.0%
Sema.NumGenericSignatureBuilders 995,090 993,599 -1,491 -0.15%
Sema.NumLazyGenericEnvironments 8,460,420 8,455,877 -4,543 -0.05%
Sema.NumLazyGenericEnvironmentsLoaded 187,556 187,396 -160 -0.09%
Sema.NumLazyIterableDeclContexts 5,646,039 5,641,095 -4,944 -0.09%
Sema.NumLeafScopes 9,325,058 9,324,192 -866 -0.01%
Sema.NumTypesDeserialized 14,049,398 14,030,272 -19,126 -0.14%
Sema.NumTypesValidated 1,221,533 1,221,533 0 0.0%
Sema.NumUnloadedLazyIterableDeclContexts 3,587,752 3,586,808 -944 -0.03%
Sema.OverriddenDeclsRequest 6,965,251 6,938,253 -26,998 -0.39%
Sema.RequirementRequest 59,843 59,843 0 0.0%
Sema.SelfBoundsFromWhereClauseRequest 5,556,479 5,540,065 -16,414 -0.3%
Sema.SetterAccessLevelRequest 125,687 125,687 0 0.0%
Sema.SuperclassDeclRequest 59,105 58,885 -220 -0.37%
Sema.SuperclassTypeRequest 28,401 28,401 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 27,952 27,952 0 0.0%
Sema.USRGenerationRequest 11,843,487 11,780,999 -62,488 -0.53%
Sema.UnderlyingTypeDeclsReferencedRequest 132,994 132,733 -261 -0.2%

Release

release brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 25,587,576,305,448 25,581,453,854,117 -6,122,451,331 -0.02%
LLVM.NumLLVMBytesOutput 785,564,612 785,567,140 2,528 0.0%
time.swift-driver.wall 4044.2s 4046.7s 2.5s 0.06%

release detailed

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
name old new delta delta_pct
AST.NumImportedExternalDefinitions 214,665 214,665 0 0.0%
AST.NumLoadedModules 16,334 16,334 0 0.0%
AST.NumTotalClangImportedEntities 729,870 729,870 0 0.0%
AST.NumUsedConformances 226,711 226,711 0 0.0%
IRModule.NumIRBasicBlocks 3,233,933 3,233,933 0 0.0%
IRModule.NumIRFunctions 1,492,255 1,492,255 0 0.0%
IRModule.NumIRGlobals 1,630,037 1,630,037 0 0.0%
IRModule.NumIRInsts 29,472,956 29,472,956 0 0.0%
IRModule.NumIRValueSymbols 2,909,605 2,909,605 0 0.0%
LLVM.NumLLVMBytesOutput 785,564,612 785,567,140 2,528 0.0%
SILModule.NumSILGenFunctions 649,899 649,899 0 0.0%
SILModule.NumSILOptFunctions 883,528 883,528 0 0.0%
Sema.NumConformancesDeserialized 2,207,769 2,207,769 0 0.0%
Sema.NumConstraintScopes 12,859,622 12,860,686 1,064 0.01%
Sema.NumDeclsDeserialized 5,959,238 5,959,238 0 0.0%
Sema.NumDeclsValidated 1,031,889 1,031,889 0 0.0%
Sema.NumFunctionsTypechecked 426,107 426,107 0 0.0%
Sema.NumGenericSignatureBuilders 188,939 188,939 0 0.0%
Sema.NumLazyGenericEnvironments 1,232,035 1,232,035 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 20,965 20,965 0 0.0%
Sema.NumLazyIterableDeclContexts 758,183 758,183 0 0.0%
Sema.NumTypesDeserialized 3,155,335 3,155,335 0 0.0%
Sema.NumTypesValidated 613,443 613,443 0 0.0%

@damuellen
Copy link
Contributor

I just tried the toolchain.
And unfortunately I had to find out that the type check has problems with long expressions again.

precedencegroup ExponentiationPrecedence {
  associativity: right
  higherThan: MultiplicationPrecedence
}

infix operator **: ExponentiationPrecedence
infix operator **=: AssignmentPrecedence

extension Double {
  static func ** (lhs: Double, rhs: Double) -> Double {
    return pow(lhs, rhs)
  }

  static func **= (lhs: inout Double, rhs: Double) {
    lhs = lhs ** rhs
  }
}

let h_261 = 1.51129 * 261 + 1.2941 / 1_000 * 261 ** 2
  + 1.23697 / 10 ** 7 * 261 ** 3 - 0.62677 // kJ/kg


error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
  + 1.23697 / 10.0 ** 7.0 * 261.0 ** 3.0 - 0.62677 // kJ/kg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~

@beccadax
Copy link
Contributor Author

@damuellen Can you try the latest master snapshot and see if you have the same issue? I'm not sure how this PR would affect an expression with no key paths.

@natecook1000
Copy link
Member

@swift-ci Please build toolchain macOS platform

@beccadax beccadax force-pushed the keypath_form_closure-squash branch from bba37e7 to c36d348 Compare April 13, 2019 02:44
@beccadax
Copy link
Contributor Author

@swift-ci please test

@beccadax
Copy link
Contributor Author

@swift-ci please test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - bba37e79aa889bfb61592df3e5e5bb8fc49f8009

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - bba37e79aa889bfb61592df3e5e5bb8fc49f8009

@beccadax
Copy link
Contributor Author

@swift-ci please test macos platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c36d3489c15cbcbbdef320aa01f44ab7dc3ad37c

lib/Sema/CSDiag.cpp Outdated Show resolved Hide resolved
gregomni and others added 3 commits June 11, 2019 10:40
Fix autoclosure param interface type when it involves archetypes.

Had some repeated locals from moving this block of code around - cleaned up.

Alternate implementation where KeyPathExpr is essentially a literal type and can be either a KeyPath(R,V) or (R)->V.

Some unneccessary code now.

Implicit closure pieces need valid sourceLocs in case a coerce expr needs to refer to the beginning of the closure in `\.foo as (A) -> B`.
Removed explicit noescape from function type so `let a: (A) -> B = \.foo` is valid.
Remove optimization that optional path is always read-only KP type in CSGen, since it can also now be of function type.
Necessary to keep SE-0249 from failing tests.
@beccadax beccadax force-pushed the keypath_form_closure-squash branch from 335e774 to 223fde6 Compare June 11, 2019 17:42
@pitiphong-p
Copy link
Contributor

Will this PR and SE-0249 be merged within the Swift 5.1 release?

@beccadax
Copy link
Contributor Author

beccadax commented Jul 8, 2019

@pitiphong-p It's not looking like it'll be in 5.1, unfortunately—this implementation works in most cases, but making it work in all cases (particularly with optional chaining key paths) requires some refactoring to fix longstanding key path bugs in the typechecker, and then that refactoring has to be backported to 5.1, which is a bit risky. The proposal is still approved and the basic approach this PR takes is still valid.

@pitiphong-p
Copy link
Contributor

@brentdax Thank you for the explanation.

@shahmishal
Copy link
Member

Please update the base branch to main by Oct 5th otherwise the pull request will be closed automatically.

  • How to change the base branch: (Link)
  • More detail about the branch update: (Link)

@shahmishal shahmishal closed this Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants