Skip to content

Commit

Permalink
pajton
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar Otasevic committed Sep 7, 2024
1 parent 3c830e8 commit 706368e
Show file tree
Hide file tree
Showing 3 changed files with 12,130 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Sources/ViewInspection/Elements/TypeDerivedElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,15 @@ struct ClosureElement<T>: CastableTypeDerivedElement {
typealias RelatedType = T
static func isValid(_ node: ReflectionNode) -> Bool { node.typeInfo.typename.hasSuffix(typeInfo.typename) }
}


struct SomeClosureElement: ReflectionElement {
let node: ReflectionNode
static func isValid(_ node: ReflectionNode) -> Bool {
node.typeInfo.typename.contains("->")
}

func cast<T>(_ t: T.Type = T.self) -> T {
CastingUtils.memoryCast(node.object, T.self)
}
}
Loading

0 comments on commit 706368e

Please sign in to comment.