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 12
12
13
13
import ASTBridging
14
14
import BasicBridging
15
+ import SwiftIfConfig
15
16
@_spi ( Experimental) import SwiftLexicalLookup
16
17
import SwiftSyntax
17
- import SwiftIfConfig
18
18
19
19
private let rowCharWidth : Int = 30
20
20
@@ -46,7 +46,10 @@ public func unqualifiedLookup(
46
46
) -> Bool {
47
47
// Obtain source file and lookup position
48
48
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
+ }
50
53
let sourceLocationConverter = sourceFile. pointee. sourceLocationConverter
51
54
let buildConfiguration = CompilerBuildConfiguration (
52
55
ctx: astContext,
You can’t perform that action at this time.
0 commit comments