Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Accept baselines
  • Loading branch information
AbubakerB committed Feb 4, 2016
commit 4c93eb2e98703ae86c81721d28b03babdf24bc61
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,11 @@ tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessib
Cannot assign a 'protected' constructor type to a 'public' constructor type.
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility3.ts(22,1): error TS2322: Type 'typeof Qux' is not assignable to type 'typeof Foo'.
Cannot assign a 'private' constructor type to a 'public' constructor type.
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility3.ts(26,1): error TS2322: Type 'typeof Foo' is not assignable to type 'typeof Baz'.
Cannot assign a 'public' constructor type to a 'protected' constructor type.
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility3.ts(27,1): error TS2322: Type 'typeof Bar' is not assignable to type 'typeof Baz'.
Cannot assign a 'public' constructor type to a 'protected' constructor type.
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility3.ts(28,1): error TS2322: Type 'typeof Qux' is not assignable to type 'typeof Baz'.
Cannot assign a 'private' constructor type to a 'protected' constructor type.
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility3.ts(32,1): error TS2322: Type 'typeof Foo' is not assignable to type 'typeof Qux'.
Cannot assign a 'public' constructor type to a 'private' constructor type.
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility3.ts(33,1): error TS2322: Type 'typeof Bar' is not assignable to type 'typeof Qux'.
Cannot assign a 'public' constructor type to a 'private' constructor type.
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility3.ts(34,1): error TS2322: Type 'typeof Baz' is not assignable to type 'typeof Qux'.
Cannot assign a 'protected' constructor type to a 'private' constructor type.


==== tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility3.ts (8 errors) ====
==== tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility3.ts (3 errors) ====

class Foo {
constructor(public x: number) { }
Expand Down Expand Up @@ -48,30 +38,15 @@ tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessib

// b is protected
let b = Baz;
b = Foo; // error Foo is public
~
!!! error TS2322: Type 'typeof Foo' is not assignable to type 'typeof Baz'.
!!! error TS2322: Cannot assign a 'public' constructor type to a 'protected' constructor type.
b = Bar; // error Baz is public
~
!!! error TS2322: Type 'typeof Bar' is not assignable to type 'typeof Baz'.
!!! error TS2322: Cannot assign a 'public' constructor type to a 'protected' constructor type.
b = Foo;
b = Bar;
b = Qux; // error Qux is private
~
!!! error TS2322: Type 'typeof Qux' is not assignable to type 'typeof Baz'.
!!! error TS2322: Cannot assign a 'private' constructor type to a 'protected' constructor type.

// c is private
let c = Qux;
c = Foo; // error Foo is public
~
!!! error TS2322: Type 'typeof Foo' is not assignable to type 'typeof Qux'.
!!! error TS2322: Cannot assign a 'public' constructor type to a 'private' constructor type.
c = Bar; // error Bar is public
~
!!! error TS2322: Type 'typeof Bar' is not assignable to type 'typeof Qux'.
!!! error TS2322: Cannot assign a 'public' constructor type to a 'private' constructor type.
c = Baz; // error Baz is protected
~
!!! error TS2322: Type 'typeof Baz' is not assignable to type 'typeof Qux'.
!!! error TS2322: Cannot assign a 'protected' constructor type to a 'private' constructor type.
c = Foo;
c = Bar;
c = Baz;
20 changes: 10 additions & 10 deletions tests/baselines/reference/classConstructorAccessibility3.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ a = Qux; // error Qux is private

// b is protected
let b = Baz;
b = Foo; // error Foo is public
b = Bar; // error Baz is public
b = Foo;
b = Bar;
b = Qux; // error Qux is private

// c is private
let c = Qux;
c = Foo; // error Foo is public
c = Bar; // error Bar is public
c = Baz; // error Baz is protected
c = Foo;
c = Bar;
c = Baz;

//// [classConstructorAccessibility3.js]
var Foo = (function () {
Expand Down Expand Up @@ -66,14 +66,14 @@ a = Baz; // error Baz is protected
a = Qux; // error Qux is private
// b is protected
var b = Baz;
b = Foo; // error Foo is public
b = Bar; // error Baz is public
b = Foo;
b = Bar;
b = Qux; // error Qux is private
// c is private
var c = Qux;
c = Foo; // error Foo is public
c = Bar; // error Bar is public
c = Baz; // error Baz is protected
c = Foo;
c = Bar;
c = Baz;


//// [classConstructorAccessibility3.d.ts]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ a = Qux; // error Qux is private

// b is protected
let b = Baz;
b = Foo; // error Foo is public
b = Bar; // error Baz is public
b = Foo;
b = Bar;
b = Qux; // error Qux is private

// c is private
let c = Qux;
c = Foo; // error Foo is public
c = Bar; // error Bar is public
c = Baz; // error Baz is protected
c = Foo;
c = Bar;
c = Baz;