-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements around aliased types (#3940)
* Improvements around aliased types Issue a diagnostic error if an exported, aliased type contains nested types that aren't exported from the same package. Include methods for aliased types in the source package. Removed references to ioutil as it's been deprecated. * skip unexported fields * handle arrays * fix happy line * little more refinement * refine per feedback * array with pointer-to-type * add tests
- Loading branch information
1 parent
7daac93
commit 4a83eff
Showing
9 changed files
with
170 additions
and
14 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module test_alias_diagnostics | ||
|
||
go 1.18 |
20 changes: 20 additions & 0 deletions
20
src/go/cmd/testdata/test_alias_diagnostics/internal/internal.go
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,20 @@ | ||
package internal | ||
|
||
type Widget struct { | ||
OK bool | ||
Value WidgetValue | ||
MissingScalar WidgetProperties | ||
MissingScalarP *WidgetPropertiesP | ||
MissingSlice []WidgetThings | ||
MissingSliceP []*WidgetThingsP | ||
} | ||
|
||
type WidgetProperties struct{} | ||
|
||
type WidgetPropertiesP struct{} | ||
|
||
type WidgetThings struct{} | ||
|
||
type WidgetThingsP struct{} | ||
|
||
type WidgetValue struct{} |
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,9 @@ | ||
package test_alias_diagnostics | ||
|
||
import ( | ||
"test_alias_diagnostics/internal" | ||
) | ||
|
||
type Widget = internal.Widget | ||
|
||
type WidgetValue = internal.WidgetValue |
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