Created
May 24, 2020 13:19
Revisions
-
ngot created this gist
May 24, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ // Package A interface JContext { j: string; } function fake1 (ctx: JContext) { // type 2 console.log(ctx); } // Package B interface TContext{ t: string; } function fake2 (ctx: TContext) { // type 3 console.log(ctx); } class ContextImpl implements JContext, TContext { j: string; t: string; constructor(j: string, t: string){ this.j = j; this.t = t; } } // type 1 const a1 = new ContextImpl("a", "b"); fake1(a1); fake2(a1);