TypeScript/tests/baselines/reference/importClause_namedImports.types

34 lines
370 B
Plaintext
Raw Normal View History

Type-only imports and exports (#35200) * Add type-only support for export declarations * Use a synthetic type alias instead of binding type-only exports as a type alias * Works for re-exports! * isolatedModules works fine * Diagnostic for type-only exporting a value * Start isolated modules codefix * Update for LKG control flow changes * Type-only import clause parsing * Type-only default import checking * Type-only named imports * Fix isolated modules error * Filter namespaces down to type-only * Fix class references * Test nested namespaces * Test circular type-only imports/exports * Fix getTypeAtLocation for type-only import/export specifiers * Fix type-only generic imports * Update public APIs * Remove unused WIP comment * Type-only namespace imports * Fix factory update calls * Add grammar errors for JS usage and mixing default and named bindings * Update updateExportDeclaration API baseline * Fix grammar checking import clauses * Enums, sort of * Dedicated error for type-only enum * Skip past type-only alias symbols in quick info * Update error code in baseline * WIP: convertToTypeOnlyExport * isolatedModules codefix (single export declaration) * isolatedModules code fix (all) * Stop eliding non-type-only imports by default, add compiler flag * Update to match updated diagnostic messages * Update more baselines * Update more tests * Auto-import as type-only * Add codefix for splitting type-only import with default and named bindings * Add more services tests * Add targeted error message for "export type T;" when T exists * Add targeted error for "import type T = require(...)" * Flip emit flag * Add test for preserveUnusedImports option * Fix flag flip on import = * Make compiler option string-valued * Fix merge conflicts * Add --importsNotUsedAsValue=error * Phrasing of messages. Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-01-03 23:39:32 +01:00
=== /abc.ts ===
export class A {}
>A : A
export type B = { b: string };
>B : B
>b : string
export const C = "";
>C : ""
>"" : ""
=== /d.ts ===
import type { A, B, C } from './abc';
>A : A
Type-only imports and exports (#35200) * Add type-only support for export declarations * Use a synthetic type alias instead of binding type-only exports as a type alias * Works for re-exports! * isolatedModules works fine * Diagnostic for type-only exporting a value * Start isolated modules codefix * Update for LKG control flow changes * Type-only import clause parsing * Type-only default import checking * Type-only named imports * Fix isolated modules error * Filter namespaces down to type-only * Fix class references * Test nested namespaces * Test circular type-only imports/exports * Fix getTypeAtLocation for type-only import/export specifiers * Fix type-only generic imports * Update public APIs * Remove unused WIP comment * Type-only namespace imports * Fix factory update calls * Add grammar errors for JS usage and mixing default and named bindings * Update updateExportDeclaration API baseline * Fix grammar checking import clauses * Enums, sort of * Dedicated error for type-only enum * Skip past type-only alias symbols in quick info * Update error code in baseline * WIP: convertToTypeOnlyExport * isolatedModules codefix (single export declaration) * isolatedModules code fix (all) * Stop eliding non-type-only imports by default, add compiler flag * Update to match updated diagnostic messages * Update more baselines * Update more tests * Auto-import as type-only * Add codefix for splitting type-only import with default and named bindings * Add more services tests * Add targeted error message for "export type T;" when T exists * Add targeted error for "import type T = require(...)" * Flip emit flag * Add test for preserveUnusedImports option * Fix flag flip on import = * Make compiler option string-valued * Fix merge conflicts * Add --importsNotUsedAsValue=error * Phrasing of messages. Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-01-03 23:39:32 +01:00
>B : B
>C : any
new A();
>new A() : A
>A : typeof A
Type-only imports and exports (#35200) * Add type-only support for export declarations * Use a synthetic type alias instead of binding type-only exports as a type alias * Works for re-exports! * isolatedModules works fine * Diagnostic for type-only exporting a value * Start isolated modules codefix * Update for LKG control flow changes * Type-only import clause parsing * Type-only default import checking * Type-only named imports * Fix isolated modules error * Filter namespaces down to type-only * Fix class references * Test nested namespaces * Test circular type-only imports/exports * Fix getTypeAtLocation for type-only import/export specifiers * Fix type-only generic imports * Update public APIs * Remove unused WIP comment * Type-only namespace imports * Fix factory update calls * Add grammar errors for JS usage and mixing default and named bindings * Update updateExportDeclaration API baseline * Fix grammar checking import clauses * Enums, sort of * Dedicated error for type-only enum * Skip past type-only alias symbols in quick info * Update error code in baseline * WIP: convertToTypeOnlyExport * isolatedModules codefix (single export declaration) * isolatedModules code fix (all) * Stop eliding non-type-only imports by default, add compiler flag * Update to match updated diagnostic messages * Update more baselines * Update more tests * Auto-import as type-only * Add codefix for splitting type-only import with default and named bindings * Add more services tests * Add targeted error message for "export type T;" when T exists * Add targeted error for "import type T = require(...)" * Flip emit flag * Add test for preserveUnusedImports option * Fix flag flip on import = * Make compiler option string-valued * Fix merge conflicts * Add --importsNotUsedAsValue=error * Phrasing of messages. Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-01-03 23:39:32 +01:00
declare let a: A;
>a : A
Type-only imports and exports (#35200) * Add type-only support for export declarations * Use a synthetic type alias instead of binding type-only exports as a type alias * Works for re-exports! * isolatedModules works fine * Diagnostic for type-only exporting a value * Start isolated modules codefix * Update for LKG control flow changes * Type-only import clause parsing * Type-only default import checking * Type-only named imports * Fix isolated modules error * Filter namespaces down to type-only * Fix class references * Test nested namespaces * Test circular type-only imports/exports * Fix getTypeAtLocation for type-only import/export specifiers * Fix type-only generic imports * Update public APIs * Remove unused WIP comment * Type-only namespace imports * Fix factory update calls * Add grammar errors for JS usage and mixing default and named bindings * Update updateExportDeclaration API baseline * Fix grammar checking import clauses * Enums, sort of * Dedicated error for type-only enum * Skip past type-only alias symbols in quick info * Update error code in baseline * WIP: convertToTypeOnlyExport * isolatedModules codefix (single export declaration) * isolatedModules code fix (all) * Stop eliding non-type-only imports by default, add compiler flag * Update to match updated diagnostic messages * Update more baselines * Update more tests * Auto-import as type-only * Add codefix for splitting type-only import with default and named bindings * Add more services tests * Add targeted error message for "export type T;" when T exists * Add targeted error for "import type T = require(...)" * Flip emit flag * Add test for preserveUnusedImports option * Fix flag flip on import = * Make compiler option string-valued * Fix merge conflicts * Add --importsNotUsedAsValue=error * Phrasing of messages. Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-01-03 23:39:32 +01:00
declare let b: B;
>b : B
b.b;
>b.b : string
>b : B
>b : string