mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
36 lines
1.4 KiB
Plaintext
36 lines
1.4 KiB
Plaintext
crashRegressionTest.ts(16,13): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
|
|
Type 'undefined' is not assignable to type 'string'.
|
|
crashRegressionTest.ts(16,56): error TS2339: Property '_name' does not exist on type 'StringTemplate'.
|
|
|
|
|
|
==== crashRegressionTest.ts (2 errors) ====
|
|
namespace MsPortal.Util.TemplateEngine {
|
|
"use strict";
|
|
|
|
interface TemplateKeyValue {
|
|
[name: string]: string;
|
|
}
|
|
|
|
class StringTemplate {
|
|
private _templateStorage: TemplateStorage;
|
|
|
|
constructor(templateStorage: TemplateStorage) {
|
|
this._templateStorage = templateStorage;
|
|
}
|
|
|
|
public text(value?: string): any {
|
|
this._templateStorage.templateSources[this._name] = value;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'.
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'string'.
|
|
~~~~~
|
|
!!! error TS2339: Property '_name' does not exist on type 'StringTemplate'.
|
|
}
|
|
}
|
|
|
|
export class TemplateStorage {
|
|
public templateSources: TemplateKeyValue = {};
|
|
public templateData: TemplateKeyValue = {};
|
|
}
|
|
}
|
|
|