Skip to content

Зернюков Никита#8

Open
daleunixal wants to merge 3 commits intoRTF-Angular-2021:masterfrom
daleunixal:master
Open

Зернюков Никита#8
daleunixal wants to merge 3 commits intoRTF-Angular-2021:masterfrom
daleunixal:master

Conversation

@daleunixal
Copy link

No description provided.

let q = new Calculator(15, 78);
let ruCalc = new DecorateRu(15,78);
let enCalc = new DecorateEn(15,78);
console.log(`${q.exec()} \n ${enCalc.exec()} \n ${ruCalc.exec()}`)
Copy link

@m-abrosimov m-abrosimov Apr 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

засчитано 1 бал

public getInstance<?>(type: ?): ? {
public getInstance<T>(type: new () => Control<T>): Control<T> {
const instanceType = type.toString()
return this._collection.find(control => control.type === instanceType);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут TypeScript компилятор выдаст ошибку. потому что ты не возвращаешь .instance

public register<?>(type: ?) {
public register<T extends Control<any>>(type: new () => T) {

}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут нет регистрации

let property: T;
let descriptor: PropertyDescriptor = {
set(value: T) {
if (!(prop in value)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет проверки на соответствие типа.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants