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-7479] "apply expression is not marked as throwing or non-throwing" #50022

Closed
swift-ci opened this issue Apr 19, 2018 · 6 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-7479
Radar rdar://39561956
Original Reporter federicotrimboli (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Version/Build:

Xcode 9.3 (9E145) with Swift Development Snapshot (2018-04-20).

Configuration:

macOS High Sierra 10.13.4 (17E199)

MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)

2.3 GHz Intel Core i5

16 GB 2133 MHz LPDDR3

Intel Iris Plus Graphics 640 1536 MB

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee federicotrimboli (JIRA)
Priority Medium

md5: 3b78ca3e16983f1843c9fa2b5c16b976

relates to:

  • SR-7243 Fatal error compiling w/4.1 "Emergency spill slot is out of reach", with -Onone -Owholemodule

Issue Description:

We are getting "apply expression is not marked as throwing or non-throwing" in our project with the latest Swift Development Snapshot.

apply expression is not marked as throwing or non-throwing
(call_expr implicit type='ComparisonResult' arg_labels=_:
  (declref_expr implicit type='(Int) -> ComparisonResult' decl=Builtin.(file).reinterpretCast [with Int, ComparisonResult] function_ref=unapplied)
  (paren_expr implicit type='(Int)'
    (declref_expr implicit type='Int' decl=Foundation.(file).ComparisonResult.init(rawValue:).rawValue function_ref=unapplied)))
0  swift                    0x000000010d575db8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x000000010d5764c6 SignalHandler(int) + 694
2  libsystem_platform.dylib 0x00007fff66eecf5a _sigtramp + 26
3  libsystem_platform.dylib 0x00000001192b6558 _sigtramp + 2990315032
4  libsystem_c.dylib        0x00007fff66c8a1ae abort + 127
5  swift                    0x000000010af62ba3 (anonymous namespace)::Verifier::verifyChecked(swift::ApplyExpr*) + 1331
6  swift                    0x000000010af561cc (anonymous namespace)::Verifier::walkToExprPost(swift::Expr*) + 300
7  swift                    0x000000010af68e3f swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) + 1327
8  swift                    0x000000010af6b467 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 359
9  swift                    0x000000010af6d995 (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 725
10 swift                    0x000000010af67fe6 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 310
11 swift                    0x000000010af6d1fb (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 475
12 swift                    0x000000010af67fd8 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 296
13 swift                    0x000000010af67e9b swift::Decl::walk(swift::ASTWalker&) + 27
14 swift                    0x000000010af554f5 swift::verify(swift::Decl*) + 133
15 swift                    0x000000010ad6173b swift::ModuleFile::verify() const + 91
16 swift                    0x000000010adcd0b8 swift::SerializedModuleLoader::verifyAllModules() + 40
17 swift                    0x000000010aee7539 swift::ASTContext::verifyAllLoadedModules() const + 89
18 swift                    0x000000010ad13e01 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int) + 2193
19 swift                    0x000000010a94c488 swift::CompilerInstance::parseAndCheckTypes(swift::CompilerInstance::ImplicitImports const&) + 744
20 swift                    0x000000010a94bd68 swift::CompilerInstance::performSema() + 472
21 swift                    0x0000000109dda830 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1904
22 swift                    0x0000000109dd90ae swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3310
23 swift                    0x0000000109d959cd main + 2317
24 libdyld.dylib            0x00007fff66bde015 start + 1
1. While walking into body of 'init(rawValue:)' in module 'Foundation'
2. While verifying ApplyExpr expression at [<invalid loc> - <invalid loc>]

Was able to reduce the problem within a small project, that I am attaching to the Radar but would prefer to not attach here.

@belkadan
Copy link
Contributor

The original issue you've reported should be fixed in master, as you've noticed. I'm not sure about the throws thing. Is that a bug or is the compiler just catching something it didn't before? If it is a bug, can you file a separate issue for that?

@belkadan
Copy link
Contributor

Oops, no, that's an assertion failure right? Maybe we can just reuse this report for that.

@swift-ci
Copy link
Collaborator Author

Comment by Federico Trimboli (JIRA)

Hi Jordan!
I believe it's an assertion failure but I'm not sure. This is the complete message:

apply expression is not marked as throwing or non-throwing
(call_expr implicit type='ComparisonResult' arg_labels=_:
  (declref_expr implicit type='(Int) -> ComparisonResult' decl=Builtin.(file).reinterpretCast [with Int, ComparisonResult] function_ref=unapplied)
  (paren_expr implicit type='(Int)'
    (declref_expr implicit type='Int' decl=Foundation.(file).ComparisonResult.init(rawValue:).rawValue function_ref=unapplied)))
0  swift                    0x000000010436bbb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x000000010436c2c6 SignalHandler(int) + 694
2  libsystem_platform.dylib 0x00007fff66eecf5a _sigtramp + 26
3  libsystem_platform.dylib 0x000000010872f558 _sigtramp + 2709792280
4  libsystem_c.dylib        0x00007fff66c8a1ae abort + 127
5  swift                    0x0000000101d364a3 (anonymous namespace)::Verifier::verifyChecked(swift::ApplyExpr*) + 1331
6  swift                    0x0000000101d29aec (anonymous namespace)::Verifier::walkToExprPost(swift::Expr*) + 300
7  swift                    0x0000000101d3c57f swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) + 1327
8  swift                    0x0000000101d3eba7 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 359
9  swift                    0x0000000101d410b5 (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 725
10 swift                    0x0000000101d3b726 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 310
11 swift                    0x0000000101d4091b (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 475
12 swift                    0x0000000101d3b718 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 296
13 swift                    0x0000000101d3b5db swift::Decl::walk(swift::ASTWalker&) + 27
14 swift                    0x0000000101d28e15 swift::verify(swift::Decl*) + 133
15 swift                    0x0000000101b33aab swift::ModuleFile::verify() const + 91
16 swift                    0x0000000101b9f388 swift::SerializedModuleLoader::verifyAllModules() + 40
17 swift                    0x0000000101cba669 swift::ASTContext::verifyAllLoadedModules() const + 89
18 swift                    0x0000000101ae5be1 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int) + 2193
19 swift                    0x000000010171d018 swift::CompilerInstance::parseAndCheckTypes(swift::CompilerInstance::ImplicitImports const&) + 744
20 swift                    0x000000010171c8f8 swift::CompilerInstance::performSema() + 472
21 swift                    0x0000000100bac500 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1904
22 swift                    0x0000000100baad7e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3310
23 swift                    0x0000000100b69133 main + 2051
24 libdyld.dylib            0x00007fff66bde015 start + 1

I think it's a new issue introduced in newer snapshots that wasn't present in the Swift 4.1 release. Should I update the "Environment" info?

@rudkx
Copy link
Member

rudkx commented May 4, 2018

federicotrimboli (JIRA User) I was unable to reproduce this with a recent build from master.

Are you still able to reproduce this with recent development builds?

@swift-ci
Copy link
Collaborator Author

swift-ci commented May 4, 2018

Comment by Federico Trimboli (JIRA)

@rudkx: I'm unable to reproduce this issue with the latest `master` snapshot (2018-04-25) nor with the latest `swift-4.2-branch` snapshot (2018-05-02).

Thanks!

@rudkx
Copy link
Member

rudkx commented May 4, 2018

Okay, it looks like this particular issue got fixed all the way, so resolving.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants