-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pacmak): multiple go (and python) issues (#2622)
The `go build` command we run during pacmak did not descend into submodules. After adding `./...` to the `go build` command, a few other issues were surfaced related to static member handling. The common issue was that `GoClass` had two separate lists (for static and non-static methods/props). This caused various places in the implementation to only take into account non-static members. Added a new list called `members` which collected both static and non-static members and used it in the various dependency props. An empty module in Python (with only submodules) will result in an empty `__all__` list which yields a MyPy error. Fixes #2618 - go build does not build submodule directories Fixes #2619 - go/python module with only submodules (no direct types) fails compilation Fixes #2620 - go missing imports if class includes only static members Fixes #2621 - invalid go imports when types referenced by static members
- Loading branch information
Elad Ben-Israel
authored
Mar 1, 2021
1 parent
adfe8b9
commit c2bd156
Showing
17 changed files
with
895 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// THIS MODULE ONLY EXPORTS SUBMODULES: it tests the case in which a module does not export direct | ||
// types but rather only exports submodules (see https://github.com/aws/jsii/issues/2619) | ||
export * as sub1 from './sub1'; | ||
export * as sub2 from './sub2'; |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export class TypeFromSub1 { | ||
public sub1() { | ||
return 'foo'; | ||
} | ||
} |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export class TypeFromSub2 { | ||
public sub2() { | ||
return 'foo'; | ||
} | ||
} |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Test for https://github.com/aws/jsii/issues/2617 | ||
*/ | ||
export class OnlyStaticMethods { | ||
public static staticMethod() { | ||
return 'hello'; | ||
} | ||
|
||
private constructor() {} | ||
} |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Oops, something went wrong.