Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions swift/ql/lib/codeql/swift/Unit.qll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** Provides the `Unit` class. */

/** The unit type. */
private newtype TUnit = TMkUnit()

/** The trivial type with a single element. */
class Unit extends TUnit {
/** Gets a textual representation of this element. */
string toString() { result = "unit" }
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
/**
* Provides Swift-specific definitions for use in the data flow library.
*/

// we need to export `Unit` for the DataFlowImpl* files
private import swift as Swift

module Private {
import DataFlowPrivate
import DataFlowDispatch

class Unit = Swift::Unit;
}

module Public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,15 +603,6 @@ int accessPathLimit() { result = 5 }
*/
predicate forceHighPrecision(Content c) { none() }

/** The unit type. */
private newtype TUnit = TMkUnit()

/** The trivial type with a single element. */
class Unit extends TUnit {
/** Gets a textual representation of this element. */
string toString() { result = "unit" }
}

/**
* Holds if the node `n` is unreachable when the call context is `call`.
*/
Expand Down
1 change: 1 addition & 0 deletions swift/ql/lib/swift.qll
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ import codeql.swift.elements.expr.ArithmeticOperation
import codeql.swift.elements.expr.LogicalOperation
import codeql.swift.elements.decl.MethodDecl
import codeql.swift.elements.decl.ClassOrStructDecl
import codeql.swift.Unit