diff --git a/Sources/Compiler/Implementation/CompilerImpl.swift b/Sources/Compiler/Implementation/CompilerImpl.swift index f4062a6d..f899eca0 100644 --- a/Sources/Compiler/Implementation/CompilerImpl.swift +++ b/Sources/Compiler/Implementation/CompilerImpl.swift @@ -15,6 +15,9 @@ internal final class CompilerImpl: ASTVisitor, StatementVisitor, ExpressionVisit internal typealias StatementResult = Void internal typealias ExpressionResult = Void + // For Swift 6.1 compatibility with Foundation. + internal typealias Expression = VioletParser.Expression + /// Program that we are compiling. private let ast: AST /// Name of the file that this code object was loaded from. diff --git a/Tests/CompilerTests/ASTCreator.swift b/Tests/CompilerTests/ASTCreator.swift index d605fa2f..155f8166 100644 --- a/Tests/CompilerTests/ASTCreator.swift +++ b/Tests/CompilerTests/ASTCreator.swift @@ -12,6 +12,9 @@ internal protocol ASTCreator {} extension ASTCreator { + // For Swift 6.1 compatibility with Foundation. + typealias Expression = VioletParser.Expression + private var id: ASTNodeId { // We have to increment 'id', because it is used as a key in 'SymbolTable'. let value = _id diff --git a/Tests/CompilerTests/CompileTestCase.swift b/Tests/CompilerTests/CompileTestCase.swift index 033b1007..3b8456a2 100644 --- a/Tests/CompilerTests/CompileTestCase.swift +++ b/Tests/CompilerTests/CompileTestCase.swift @@ -7,6 +7,9 @@ import VioletBytecode /// Base class for all of the compiler tests internal class CompileTestCase: XCTestCase, ASTCreator { + // For Swift 6.1 compatibility with Foundation. + typealias Expression = VioletParser.Expression + internal var builder = ASTBuilder() // MARK: - Compile diff --git a/Tests/CompilerTests/SymbolTableTestCase.swift b/Tests/CompilerTests/SymbolTableTestCase.swift index 51e5e076..b23eb6c7 100644 --- a/Tests/CompilerTests/SymbolTableTestCase.swift +++ b/Tests/CompilerTests/SymbolTableTestCase.swift @@ -6,6 +6,9 @@ import VioletParser /// Base class for all of the symbol table tests class SymbolTableTestCase: XCTestCase, ASTCreator { + // For Swift 6.1 compatibility with Foundation. + typealias Expression = VioletParser.Expression + var builder = ASTBuilder() // MARK: - Create diff --git a/Tests/RapunzelTests/Lyrics.swift b/Tests/RapunzelTests/Lyrics.swift index 6cc1dee3..9231638e 100644 --- a/Tests/RapunzelTests/Lyrics.swift +++ b/Tests/RapunzelTests/Lyrics.swift @@ -51,7 +51,7 @@ extension Lyrics { "And it's warm and real and bright", "And the world has somehow shifted", "All at once everything looks different", - "Now that I see you" + "Now that I see you", ] ), @@ -68,7 +68,7 @@ extension Lyrics { "Now she's here shining in the starlight", "Now she's here suddenly I know", "If she's here it's crystal clear", - "I'm where I'm meant to go" + "I'm where I'm meant to go", ] ), Part( @@ -95,9 +95,9 @@ extension Lyrics { "All at once everything is different", "Now that I see you", - "Now that I see you" + "Now that I see you", ] - ) + ), ] } }