Skip to content

Commit

Permalink
Commit missing baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Jan 16, 2020
1 parent 8571a8a commit 8b4c235
Show file tree
Hide file tree
Showing 4 changed files with 244 additions and 0 deletions.
60 changes: 60 additions & 0 deletions tests/baselines/reference/computedPropertyName.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
tests/cases/conformance/externalModules/typeOnly/component.ts(12,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
tests/cases/conformance/externalModules/typeOnly/component.ts(16,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
tests/cases/conformance/externalModules/typeOnly/component.ts(20,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
tests/cases/conformance/externalModules/typeOnly/component.ts(24,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.


==== tests/cases/conformance/externalModules/typeOnly/framework-hooks.ts (0 errors) ====
export const onInit = Symbol("onInit");

==== tests/cases/conformance/externalModules/typeOnly/component.ts (4 errors) ====
import type { onInit } from "./framework-hooks";

interface Component {
[onInit]?(): void;
}

type T = {
[onInit]: any;
}

const o = {
[onInit]: 0 // Error
~~~~~~
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
!!! related TS1376 tests/cases/conformance/externalModules/typeOnly/component.ts:1:15: 'onInit' was imported here.
};

class C {
[onInit]: any; // Error (because class fields)
~~~~~~
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
!!! related TS1376 tests/cases/conformance/externalModules/typeOnly/component.ts:1:15: 'onInit' was imported here.
}

class D {
[onInit] = 0; // Error
~~~~~~
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
!!! related TS1376 tests/cases/conformance/externalModules/typeOnly/component.ts:1:15: 'onInit' was imported here.
}

class E {
[onInit]() {} // Error
~~~~~~
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
!!! related TS1376 tests/cases/conformance/externalModules/typeOnly/component.ts:1:15: 'onInit' was imported here.
}

abstract class F {
abstract [onInit](): void;
}

class G {
declare [onInit]: any;
}

declare class H {
[onInit]: any;
}

51 changes: 51 additions & 0 deletions tests/baselines/reference/computedPropertyName.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,59 @@ import type { onInit } from "./framework-hooks";
interface Component {
[onInit]?(): void;
}

type T = {
[onInit]: any;
}

const o = {
[onInit]: 0 // Error
};

class C {
[onInit]: any; // Error (because class fields)
}

class D {
[onInit] = 0; // Error
}

class E {
[onInit]() {} // Error
}

abstract class F {
abstract [onInit](): void;
}

class G {
declare [onInit]: any;
}

declare class H {
[onInit]: any;
}


//// [framework-hooks.js]
export const onInit = Symbol("onInit");
//// [component.js]
var _a;
const o = {
[onInit]: 0 // Error
};
class C {
}
class D {
constructor() {
this[_a] = 0; // Error
}
}
_a = onInit;
class E {
[onInit]() { } // Error
}
class F {
}
class G {
}
65 changes: 65 additions & 0 deletions tests/baselines/reference/computedPropertyName.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,68 @@ interface Component {
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
}

type T = {
>T : Symbol(T, Decl(component.ts, 4, 1))

[onInit]: any;
>[onInit] : Symbol([onInit], Decl(component.ts, 6, 10))
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
}

const o = {
>o : Symbol(o, Decl(component.ts, 10, 5))

[onInit]: 0 // Error
>[onInit] : Symbol([onInit], Decl(component.ts, 10, 11))
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))

};

class C {
>C : Symbol(C, Decl(component.ts, 12, 2))

[onInit]: any; // Error (because class fields)
>[onInit] : Symbol(C[onInit], Decl(component.ts, 14, 9))
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
}

class D {
>D : Symbol(D, Decl(component.ts, 16, 1))

[onInit] = 0; // Error
>[onInit] : Symbol(D[onInit], Decl(component.ts, 18, 9))
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
}

class E {
>E : Symbol(E, Decl(component.ts, 20, 1))

[onInit]() {} // Error
>[onInit] : Symbol(E[onInit], Decl(component.ts, 22, 9))
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
}

abstract class F {
>F : Symbol(F, Decl(component.ts, 24, 1))

abstract [onInit](): void;
>[onInit] : Symbol(F[onInit], Decl(component.ts, 26, 18))
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
}

class G {
>G : Symbol(G, Decl(component.ts, 28, 1))

declare [onInit]: any;
>[onInit] : Symbol(G[onInit], Decl(component.ts, 30, 9))
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
}

declare class H {
>H : Symbol(H, Decl(component.ts, 32, 1))

[onInit]: any;
>[onInit] : Symbol(H[onInit], Decl(component.ts, 34, 17))
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
}

68 changes: 68 additions & 0 deletions tests/baselines/reference/computedPropertyName.types
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,71 @@ interface Component {
>onInit : unique symbol
}

type T = {
>T : T

[onInit]: any;
>[onInit] : any
>onInit : unique symbol
}

const o = {
>o : { [onInit]: number; }
>{ [onInit]: 0 // Error} : { [onInit]: number; }

[onInit]: 0 // Error
>[onInit] : number
>onInit : unique symbol
>0 : 0

};

class C {
>C : C

[onInit]: any; // Error (because class fields)
>[onInit] : any
>onInit : unique symbol
}

class D {
>D : D

[onInit] = 0; // Error
>[onInit] : number
>onInit : unique symbol
>0 : 0
}

class E {
>E : E

[onInit]() {} // Error
>[onInit] : () => void
>onInit : unique symbol
}

abstract class F {
>F : F

abstract [onInit](): void;
>[onInit] : () => void
>onInit : unique symbol
}

class G {
>G : G

declare [onInit]: any;
>[onInit] : any
>onInit : unique symbol
}

declare class H {
>H : H

[onInit]: any;
>[onInit] : any
>onInit : unique symbol
}

0 comments on commit 8b4c235

Please sign in to comment.