getLine<K extends keyof this['lines']>(id: K): this['lines'][K] {
if (!(id in this.lines))
- throw new NotFoundError(`Form ${this.name} does not have line ${id}`);
+ throw new NotFoundError(`Form ${this.name} does not have line ${id.toString()}`);
// This coercion is safe: the method's generic constraint for K ensures
// a valid key in |lines|, and the abstract declaration of |lines| ensures
// the correct index type.
getInput<K extends keyof I>(name: K): I[K] {
if (!(name in this._input)) {
- throw new NotFoundError(`No input with key ${name} on form ${this.name}`);
+ throw new NotFoundError(`No input with key ${String(name)} on form ${this.name}`);
}
- Trace.mark(`${this.name} input: ${name}`);
+ Trace.mark(`${this.name} input: ${String(name)}`);
return this._input[name];
}
// the one the Line is in, erase |form|'s type with |as any| to
// keep TypeScript happy.
constructor(form: FormClass<F>, line: L, description?: string, fallback?: T, options?: LineOptions) {
- super(description || `Reference ${form.name}@${line}`, options);
+ super(description || `Reference ${form.name}@${line.toString()}`, options);
this._form = form;
this._line = line;
this._fallback = fallback;
private _key: K;
constructor(form: FormClass<F>, key: K, description?: string, options?: LineOptions) {
- super(description || `Reference ${form.name}/${key}`, options);
+ super(description || `Reference ${form.name}/${String(key)}`, options);
this._form = form;
this._key = key;
}
form: Form<U>;
constructor(input: T, description?: string, fallback?: U[T], options?: LineOptions) {
- super(description || `Input from ${input}`, options);
+ super(description || `Input from ${String(input)}`, options);
this._input = input;
this._fallback = fallback;
}
private _line: L;
constructor(form: FormClass<F>, line: L, description?: string, options?: LineOptions) {
- super(description || `Accumulator ${form.name}@${line}`, options);
+ super(description || `Accumulator ${form.name}@${line.toString()}`, options);
this._form = form;
this._line = line;
}