File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
lib/ASTGen/Sources/ASTGen Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1212
1313import ASTBridging
1414import BasicBridging
15+ import SwiftIfConfig
1516@_spi ( Experimental) import SwiftLexicalLookup
1617import SwiftSyntax
17- import SwiftIfConfig
1818
1919private let rowCharWidth : Int = 30
2020
@@ -46,7 +46,10 @@ public func unqualifiedLookup(
4646) -> Bool {
4747 // Obtain source file and lookup position
4848 let sourceFile = sourceFilePtr. assumingMemoryBound ( to: ExportedSourceFile . self)
49- let sourceFileSyntax = sourceFile. pointee. syntax
49+ guard let sourceFileSyntax = sourceFile. pointee. syntax. as ( SourceFileSyntax . self) else {
50+ print ( " Could not cast exported source file to SourceFileSyntax " )
51+ return false
52+ }
5053 let sourceLocationConverter = sourceFile. pointee. sourceLocationConverter
5154 let buildConfiguration = CompilerBuildConfiguration (
5255 ctx: astContext,
You can’t perform that action at this time.
0 commit comments