X 归档 2020-02-20
@tatomyr2 That’s not type-safe:
type Spanish = 'no' | 'sí';
type English = 'no' | 'yes';
const spanishWord: Spanish = 'no';
const englishWord: English = spanishWord;
type Spanish = 'no' | 'sí';
type English = 'no' | 'yes';
const spanishWord: Spanish = 'no';
const englishWord: English = spanishWord;
@tatomyr2 这可不是类型安全的:
type Spanish = 'no' | 'sí';
type English = 'no' | 'yes';
const spanishWord: Spanish = 'no';
const englishWord: English = spanishWord;
type Spanish = 'no' | 'sí';
type English = 'no' | 'yes';
const spanishWord: Spanish = 'no';
const englishWord: English = spanishWord;


