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

fix(go): invalid code when a module only has static methods [test only] #2704

Merged
merged 2 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions packages/jsii-calc/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ 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';
export * as module2689 from './module2689';
export * as module2692 from './module2692';
export * as module2530 from './module2530';
11 changes: 11 additions & 0 deletions packages/jsii-calc/lib/module2617/index.ts
Original file line number Diff line number Diff line change
@@ -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() {}
}
52 changes: 48 additions & 4 deletions packages/jsii-calc/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,13 @@
"jsii-calc.module2530": {
"locationInModule": {
"filename": "lib/index.ts",
"line": 17
"line": 18
}
},
"jsii-calc.module2617": {
"locationInModule": {
"filename": "lib/index.ts",
"line": 15
}
},
"jsii-calc.module2647": {
Expand All @@ -226,7 +232,7 @@
"jsii-calc.module2689": {
"locationInModule": {
"filename": "lib/index.ts",
"line": 15
"line": 16
}
},
"jsii-calc.module2689.methods": {
Expand Down Expand Up @@ -256,7 +262,7 @@
"jsii-calc.module2692": {
"locationInModule": {
"filename": "lib/index.ts",
"line": 16
"line": 17
}
},
"jsii-calc.module2692.submodule1": {
Expand Down Expand Up @@ -14251,6 +14257,44 @@
"name": "MyClass",
"namespace": "module2530"
},
"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 @@ -15422,5 +15466,5 @@
}
},
"version": "3.20.120",
"fingerprint": "hBZRskNm0XPeSO9U+PMqKKVZ2faqmKnE9eVN2tY1Wik="
"fingerprint": "NN/7JA2G5+NzNqrZC0MowhGB3DS5OlSmsNIF8KMR7Kg="
}

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.

Loading