From 24d35c35a1e2fc10409f21c0dd4387045019e7a0 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 17 Feb 2021 16:42:17 +0000 Subject: [PATCH] Add Unit class to DataFlowPrivate --- ql/src/semmle/go/dataflow/internal/DataFlowPrivate.qll | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ql/src/semmle/go/dataflow/internal/DataFlowPrivate.qll b/ql/src/semmle/go/dataflow/internal/DataFlowPrivate.qll index a67e35873e7..db6f3651a4e 100644 --- a/ql/src/semmle/go/dataflow/internal/DataFlowPrivate.qll +++ b/ql/src/semmle/go/dataflow/internal/DataFlowPrivate.qll @@ -243,6 +243,15 @@ predicate isUnreachableInCall(Node n, DataFlowCall call) { int accessPathLimit() { result = 5 } +/** 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" } +} + /** * Gets the `i`th argument of call `c`, where the receiver of a method call * counts as argument -1.