@@ -26,7 +26,7 @@ class TrapLabelManager {
2626 private var nextInt: Int = 100
2727
2828 /* * Returns a fresh label. */
29- fun <T > getFreshLabel (): Label <T > {
29+ fun <T : AnyDbType > getFreshLabel (): Label <T > {
3030 return IntLabel (nextInt++ )
3131 }
3232
@@ -64,7 +64,7 @@ open class TrapWriter (protected val loggerBase: LoggerBase, val lm: TrapLabelMa
6464 * `getLabelFor` instead, which allows non-existent labels to be
6565 * initialised.
6666 */
67- fun <T > getExistingLabelFor (key : String ): Label <T >? {
67+ fun <T : AnyDbType > getExistingLabelFor (key : String ): Label <T >? {
6868 return lm.labelMapping.get(key)?.cast<T >()
6969 }
7070 /* *
@@ -73,7 +73,7 @@ open class TrapWriter (protected val loggerBase: LoggerBase, val lm: TrapLabelMa
7373 * is run on it, and it is returned.
7474 */
7575 @JvmOverloads // Needed so Java can call a method with an optional argument
76- fun <T > getLabelFor (key : String , initialise : (Label <T >) -> Unit = {}): Label <T > {
76+ fun <T : AnyDbType > getLabelFor (key : String , initialise : (Label <T >) -> Unit = {}): Label <T > {
7777 val maybeLabel: Label <T >? = getExistingLabelFor(key)
7878 if (maybeLabel == null ) {
7979 val label: Label <T > = lm.getFreshLabel()
@@ -89,7 +89,7 @@ open class TrapWriter (protected val loggerBase: LoggerBase, val lm: TrapLabelMa
8989 /* *
9090 * Returns a label for a fresh ID (i.e. a new label bound to `*`).
9191 */
92- fun <T > getFreshIdLabel (): Label <T > {
92+ fun <T : AnyDbType > getFreshIdLabel (): Label <T > {
9393 val label: Label <T > = lm.getFreshLabel()
9494 writeTrap(" $label = *\n " )
9595 return label
0 commit comments