Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScriptNamespace override not performed #49

Open
andry-tino opened this issue Jul 3, 2017 · 0 comments
Open

ScriptNamespace override not performed #49

andry-tino opened this issue Jul 3, 2017 · 0 comments

Comments

@andry-tino
Copy link
Owner

andry-tino commented Jul 3, 2017

Discovered by newly introduced StringRendering tests. TestSuite: Rosetta\test\renderers\ScriptSharp.Definition.ASTWalker.Renderings.Tests\TestSuite.cs, test: TestClassesWithScriptNamespace.

What

Classes and enums are emitted:

  • No declared enclosing module/namespace
  • No ScriptNamespace override

Output for classes

Summary
-------
ScriptNamespace.SingleClass.d.ts
--------------------------------
Found 1 difference(s).
LEFT
====
declare class Class1 {
  method1(param1 : number) : void;
  method2(param1 : number, param2 : string) : void;
  method3(param1 : number, param2 : string, param3 : boolean) : void;
  method4(param1 : number, param2 : string, param3 : boolean, param4 : number) : void;
}
RIGHT
====


ScriptNamespace.SingleNamespacedClass.d.ts
------------------------------------------
Found 1 difference(s).
LEFT
====
declare module MyOriginalNamespace {
  export class Class1 {
    method1(param1 : number) : void;
    method2(param1 : number, param2 : string) : void;
    method3(param1 : number, param2 : string, param3 : boolean) : void;
    method4(param1 : number, param2 : string, param3 : boolean, param4 : number) : void;
  }
}
RIGHT
====


ScriptNamespace.TwoClasses.d.ts
-------------------------------
Found 1 difference(s).
LEFT
====
declare class Class1 {
  method1(param1 : number) : void;
  method2(param1 : number, param2 : string) : void;
}
declare class Class2 {
  method1(param1 : number) : void;
  method2(param1 : number, param2 : string) : void;
}
RIGHT
====


ScriptNamespace.TwoNamespacedClasses.d.ts
-----------------------------------------
Found 1 difference(s).
LEFT
====
declare module MyOriginalNamespace {
  export class Class1 {
    method1(param1 : number) : void;
    method2(param1 : number, param2 : string) : void;
  }

  export class Class2 {
    method1(param1 : number) : void;
    method2(param1 : number, param2 : string) : void;
  }
}
RIGHT
====


ScriptNamespace.TwoMixedClasses.d.ts
------------------------------------
Found 1 difference(s).
LEFT
====
declare class Class1 {
  method1(param1 : number) : void;
  method2(param1 : number, param2 : string) : void;
}
declare class Class2 {
  method1(param1 : number) : void;
  method2(param1 : number, param2 : string) : void;
}
RIGHT
====


ScriptNamespace.TwoMixedNamespacedClasses.d.ts
----------------------------------------------
Found 1 difference(s).
LEFT
====
declare module MyOriginalNamespace {
  export class Class1 {
    method1(param1 : number) : void;
    method2(param1 : number, param2 : string) : void;
  }

  export class Class2 {
    method1(param1 : number) : void;
    method2(param1 : number, param2 : string) : void;
  }
}
RIGHT
====

Output for enums

Summary
-------
ScriptNamespace.SingleEnum.d.ts
-------------------------------
Found 1 difference(s).
LEFT
====
declare enum Enum1 {
  Value1
}
RIGHT
====


ScriptNamespace.SingleNamespacedEnum.d.ts
-----------------------------------------
Found 1 difference(s).
LEFT
====
declare module MyOriginalNamespace {
  export enum Enum1 {
    Value1
  }
}
RIGHT
====


ScriptNamespace.TwoEnums.d.ts
-----------------------------
Found 1 difference(s).
LEFT
====
declare enum Enum1 {
  Value1
}
declare enum Enum2 {
  Value1
}
RIGHT
====


ScriptNamespace.TwoNamespacedEnums.d.ts
---------------------------------------
Found 1 difference(s).
LEFT
====
declare module MyOriginalNamespace {
  export enum Enum1 {
    Value1
  }

  export enum Enum2 {
    Value1
  }
}
RIGHT
====


ScriptNamespace.TwoMixedEnums.d.ts
----------------------------------
Found 1 difference(s).
LEFT
====
declare enum Enum1 {
  Value1
}
declare enum Enum2 {
  Value1
}
RIGHT
====


ScriptNamespace.TwoMixedNamespacedEnums.d.ts
--------------------------------------------
Found 1 difference(s).
LEFT
====
declare module MyOriginalNamespace {
  export enum Enum1 {
    Value1
  }

  export enum Enum2 {
    Value1
  }
}
RIGHT
====

Output for interfaces

Summary
-------
ScriptNamespace.SingleInterface.d.ts
------------------------------------
Found 1 difference(s).
LEFT
====
declare interface IInterface1 {
}
RIGHT
====


ScriptNamespace.SingleNamespacedInterface.d.ts
----------------------------------------------
Found 1 difference(s).
LEFT
====
declare module MyOriginalNamespace {
  export interface IInterface1 {
  }
}
RIGHT
====


ScriptNamespace.TwoInterfaces.d.ts
----------------------------------
Found 1 difference(s).
LEFT
====
declare interface IInterface1 {
}
declare interface IInterface2 {
}
RIGHT
====


ScriptNamespace.TwoNamespacedInterfaces.d.ts
--------------------------------------------
Found 1 difference(s).
LEFT
====
declare module MyOriginalNamespace {
  export interface IInterface1 {
  }

  export interface IInterface2 {
  }
}
RIGHT
====


ScriptNamespace.TwoMixedInterfaces.d.ts
---------------------------------------
Found 1 difference(s).
LEFT
====
declare interface IInterface1 {
}
declare interface IInterface2 {
}
RIGHT
====


ScriptNamespace.TwoMixedNamespacedInterfaces.d.ts
-------------------------------------------------
Found 1 difference(s).
LEFT
====
declare module MyOriginalNamespace {
  export interface IInterface1 {
  }

  export interface IInterface2 {
  }
}
RIGHT
====
@andry-tino andry-tino self-assigned this Jul 3, 2017
@andry-tino andry-tino added regression and removed bug labels Jul 3, 2017
andry-tino added a commit that referenced this issue Jul 6, 2017
Adding archetypes and enabling StringRendering tests.

We discovered issues in ScriptSharp renderings (those concerning
ScriptNamespace as they are using old mechanism based on
SyntaxTransformer and Roslyn SemanticModel for rendering). Those tests
were disabled and bug opened.

References #49
Closes #47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment