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

[SR-8804] Type inference regression in Swift 4.2 #51312

Open
swift-ci opened this issue Sep 20, 2018 · 3 comments
Open

[SR-8804] Type inference regression in Swift 4.2 #51312

swift-ci opened this issue Sep 20, 2018 · 3 comments
Labels
access control Feature → modifiers: Access control and access levels bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 4.2 type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-8804
Radar rdar://problem/44643736
Original Reporter Tainnor (JIRA User)
Type Bug
Environment

Swift 4.2

macOS

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 4.2Regression, TypeChecker
Assignee None
Priority Medium

md5: 38f7d64a8099d323ebfc0ee8f85ac61e

Issue Description:

Currently, it seems impossible to compile SwiftParsec (https://github.com/davedufresne/SwiftParsec) with Swift 4.2, because the compiler will emit the following error:

> error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

The problem appears to be this expression: https://github.com/davedufresne/SwiftParsec/blob/master/Sources/SwiftParsec/LanguageDefinition.swift#L292

However, this library compiles without problems in Swift 4.1.2.

Did anything substantial change about the type inference algorithm or what could be a likely explanation for this change in compiler behaviour?

@belkadan
Copy link
Contributor

cc @rudkx, @xedin

@rudkx
Copy link
Member

rudkx commented Sep 20, 2018

@swift-ci create

@rudkx
Copy link
Member

rudkx commented Sep 20, 2018

I don't know of a specific change offhand that would cause this, but it's not uncommon to see large sequences of operations result in the "unable to type check" message. We're working on trying to improve that situation to reduce the chance of regressing like this in the future.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added regression swift 4.2 access control Feature → modifiers: Access control and access levels and removed 4.2 regression labels Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
access control Feature → modifiers: Access control and access levels bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 4.2 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants