Linux compiler error: Original inits are always after the '='"

I have some code that compiles fine on Mac (Xcode 12 GM) but fails on Linux (Swift 5.3). I haven't been able yet to create a reproducer that doesn't require half of my codebase, but it seems to be related to adding a get-property via protocol extension.

Adding -Xswiftc -disable-astscope-lookup as per the error suggestion fixes the issue, but I'm wondering what this means? Am I doing something that I shouldn't be doing?

swift: /home/buildnode/jenkins/workspace/oss-swift-5.3-package-linux-ubuntu-18_04/swift/lib/AST/ASTScopeCreation.cpp:1276: swift::ast_scope::AnnotatedInsertionPoint swift::ast_scope::PatternEntryDeclScope::expandAScopeThatCreatesANewInsertionPoint(swift::ast_scope::ScopeCreator &): Assertion `(!getSourceManager().isBeforeInBuffer( patternEntry.getOriginalInit()->getStartLoc(), decl->getStartLoc())) && "Original inits are always after the '='" " Try compiling with '-disable-astscope-lookup'."' failed.

Terms of Service

Privacy Policy

Cookie Policy