Skip to content

Commit

Permalink
fix(go): invalid code when a module only has static methods [test only]
Browse files Browse the repository at this point in the history
This was already fixed by #2622. This PR introduces a test to avoid regression.

Fixes #2617
  • Loading branch information
Elad Ben-Israel committed Mar 15, 2021
1 parent daca06f commit 3eda699
Show file tree
Hide file tree
Showing 10 changed files with 284 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/jsii-calc/lib/index.ts
Expand Up @@ -12,3 +12,5 @@ export * as submodule from './submodule';
export * as onlystatic from './only-static';
export * as nodirect from './no-direct-types';
export * as module2647 from './module2647';

export * as module2617 from './module2617';
11 changes: 11 additions & 0 deletions packages/jsii-calc/lib/module2617/index.ts
@@ -0,0 +1,11 @@
// @see https://github.com/aws/jsii/issues/2617

export class OnlyStatics {
public static foo() {
return;
}
public static bar() {
return;
}
private constructor() {}
}
46 changes: 45 additions & 1 deletion packages/jsii-calc/test/assembly.jsii
Expand Up @@ -211,6 +211,12 @@
"line": 142
}
},
"jsii-calc.module2617": {
"locationInModule": {
"filename": "lib/index.ts",
"line": 16
}
},
"jsii-calc.module2647": {
"locationInModule": {
"filename": "lib/index.ts",
Expand Down Expand Up @@ -14125,6 +14131,44 @@
"name": "CompositionStringStyle",
"namespace": "composition.CompositeOperation"
},
"jsii-calc.module2617.OnlyStatics": {
"assembly": "jsii-calc",
"docs": {
"stability": "stable"
},
"fqn": "jsii-calc.module2617.OnlyStatics",
"kind": "class",
"locationInModule": {
"filename": "lib/module2617/index.ts",
"line": 3
},
"methods": [
{
"docs": {
"stability": "stable"
},
"locationInModule": {
"filename": "lib/module2617/index.ts",
"line": 7
},
"name": "bar",
"static": true
},
{
"docs": {
"stability": "stable"
},
"locationInModule": {
"filename": "lib/module2617/index.ts",
"line": 4
},
"name": "foo",
"static": true
}
],
"name": "OnlyStatics",
"namespace": "module2617"
},
"jsii-calc.module2647.ExtendAndImplement": {
"assembly": "jsii-calc",
"base": "@scope/jsii-calc-lib.BaseFor2647",
Expand Down Expand Up @@ -14952,5 +14996,5 @@
}
},
"version": "3.20.120",
"fingerprint": "jhFZc5fa0gXEmH6s8wlAhaQm8CX/ZCHNvpY1jXxwMgE="
"fingerprint": "BknY5b4Ac0OyJjPD+Cy7kKx4HRZj/enS7zbnu8n5MsM="
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3eda699

Please sign in to comment.