Skip to content

Commit

Permalink
Fix variable reference
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlabelle committed Dec 25, 2024
1 parent 160e252 commit 6ad2441
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Generator/Sources/ProjectionModel/Projection+types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import CodeWriters
extension Projection {
public func toTypeExpression(_ type: TypeNode, outerNullable: Bool = true) throws -> SwiftType {
switch type {
case let .bound(type):
if let specialTypeBinding = try getSpecialTypeBinding(type) {
case let .bound(boundType):
if let specialTypeBinding = try getSpecialTypeBinding(boundType) {
return specialTypeBinding.swiftType
}

let boundSwiftType = try SwiftType.named(
let swiftType = try SwiftType.named(
toTypeName(boundType.definition),
genericArgs: boundType.genericArgs.map { try toTypeExpression($0) })
return type.definition.isReferenceType && outerNullable ? boundSwiftType.optional() : boundSwiftType
return boundType.definition.isReferenceType && outerNullable ? swiftType.optional() : swiftType
case let .genericParam(param):
return .named(param.name)
case let .array(of: element):
Expand Down

0 comments on commit 6ad2441

Please sign in to comment.