-
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(go): missing imports required by collection types (#2691)
When a foreign type is referenced within a complex type (array/list), it wasn't included in the import rendering. Fixes #2689
- Loading branch information
Elad Ben-Israel
authored
Mar 15, 2021
1 parent
daca06f
commit c9a36a6
Showing
16 changed files
with
1,635 additions
and
10 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,10 @@ | ||
// | ||
// Verifies that the correct imports are generated for Go code when forien types | ||
// are referenced in complex fields (array and map). | ||
// | ||
// @see https://github.com/aws/jsii/issues/2689 | ||
|
||
export * as structs from './structs'; | ||
export * as methods from './methods'; | ||
export * as props from './props'; | ||
export * as retval from './retval'; |
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,12 @@ | ||
import { BaseProps } from '@scope/jsii-calc-base'; | ||
import { Number as NumberClass } from '@scope/jsii-calc-lib'; | ||
|
||
export class MyClass { | ||
public foo(_values: NumberClass[]) { | ||
return; | ||
} | ||
|
||
public bar(_bar: { [k: string]: BaseProps }) { | ||
return; | ||
} | ||
} |
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,7 @@ | ||
import { BaseProps } from '@scope/jsii-calc-base'; | ||
import { Number as NumberClass } from '@scope/jsii-calc-lib'; | ||
|
||
export class MyClass { | ||
public readonly foo: NumberClass[] = []; | ||
public readonly bar: { [key: string]: BaseProps } = {}; | ||
} |
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,12 @@ | ||
import { BaseProps } from '@scope/jsii-calc-base'; | ||
import { Number as NumberClass } from '@scope/jsii-calc-lib'; | ||
|
||
export class MyClass { | ||
public foo(): NumberClass[] { | ||
return []; | ||
} | ||
|
||
public bar(): { [k: string]: BaseProps } { | ||
return {}; | ||
} | ||
} |
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,7 @@ | ||
import { BaseProps } from '@scope/jsii-calc-base'; | ||
import { Number as NumberClass } from '@scope/jsii-calc-lib'; | ||
|
||
export interface MyStruct { | ||
readonly numbers: NumberClass[]; | ||
readonly baseMap: { [key: string]: BaseProps }; | ||
} |
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.