-
Notifications
You must be signed in to change notification settings - Fork 567
feat(cl): add static value member semantics #2792
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
Open
KurodaKayn
wants to merge
15
commits into
goplus:main
Choose a base branch
from
KurodaKayn:static-member-semantic
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+642
−41
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
41dff38
feat(cl): compile explicit static value declarations
KurodaKayn 8f17145
feat(cl): compile classfile static values
KurodaKayn d9c050e
feat(cl): resolve static value member references
KurodaKayn 96e5f49
test(cl): cover static member recorder uses
KurodaKayn 2da805b
fix(cl): cache static member receivers
KurodaKayn c8df54a
test(cl): add static member basic testxgo case
KurodaKayn b5f4a9e
test(cl): add static member forward ref testxgo case
KurodaKayn ad9e72c
test(cl): add static member receiver order testxgo case
KurodaKayn 5697939
test(cl): add static member unicode testxgo case
KurodaKayn be1a970
test(cl): add static member selector shadow testxgo case
KurodaKayn 6694fa0
test(cl): add classfile static member spx case
KurodaKayn 0a6f72c
test(cl): add classfile static before fields spx case
KurodaKayn c007925
test(cl): add classfile mixed static field spx case
KurodaKayn bb55e56
test(cl): cover static member errors
KurodaKayn 2fac8bc
test(cl): cover classfile static member recorder
KurodaKayn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,14 @@ | ||
| const .name = "rect" | ||
| var ( | ||
| .count int = 100 | ||
| Rect.total int = 200 | ||
| ) | ||
|
|
||
| func Get() string { | ||
| return name | ||
| } | ||
|
|
||
| func Inc() { | ||
| count++ | ||
| Rect.total++ | ||
| } |
This file contains hidden or 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,17 @@ | ||
| package main | ||
|
|
||
| const XGos_Rect_Name = "rect" | ||
|
|
||
| type Rect struct { | ||
| } | ||
|
|
||
| var XGos_Rect_Count int = 100 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be XGos_Rect_count |
||
| var XGos_Rect_Total int = 200 | ||
|
|
||
| func (this *Rect) Get() string { | ||
| return XGos_Rect_Name | ||
| } | ||
| func (this *Rect) Inc() { | ||
| XGos_Rect_Count++ | ||
| XGos_Rect_Total++ | ||
| } | ||
This file contains hidden or 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,8 @@ | ||
| var ( | ||
| .count int = 100 | ||
| width int = 10 | ||
| ) | ||
|
|
||
| func Get() int { | ||
| return width | ||
| } |
This file contains hidden or 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,15 @@ | ||
| package main | ||
|
|
||
| type Rect struct { | ||
| width int | ||
| } | ||
|
|
||
| var XGos_Rect_Count int = 100 | ||
|
|
||
| func (this *Rect) Get() int { | ||
| return this.width | ||
| } | ||
| func (this *Rect) XGo_Init() *Rect { | ||
| this.width = 10 | ||
| return this | ||
| } |
This file contains hidden or 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 @@ | ||
| var ( | ||
| Rect.total, width int = 200, 10 | ||
| ) | ||
|
|
||
| func Get() int { | ||
| return width + Rect.total | ||
| } |
This file contains hidden or 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,15 @@ | ||
| package main | ||
|
|
||
| type Rect struct { | ||
| width int | ||
| } | ||
|
|
||
| var XGos_Rect_Total int = 200 | ||
|
|
||
| func (this *Rect) Get() int { | ||
| return this.width + XGos_Rect_Total | ||
| } | ||
| func (this *Rect) XGo_Init() *Rect { | ||
| this.width = 10 | ||
| return this | ||
| } |
This file contains hidden or 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 @@ | ||
| type foo int | ||
|
|
||
| const foo.name = "xgo" | ||
| var foo.count int = 100 | ||
|
|
||
| a := foo.name | ||
| foo.count++ |
This file contains hidden or 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 @@ | ||
| package main | ||
|
|
||
| type foo int | ||
|
|
||
| const XGos_foo_Name = "xgo" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be |
||
|
|
||
| var XGos_foo_Count int = 100 | ||
|
|
||
| func main() { | ||
| a := XGos_foo_Name | ||
| XGos_foo_Count++ | ||
| } | ||
This file contains hidden or 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 @@ | ||
| type foo int | ||
|
|
||
| func Name() string { | ||
| return foo.name | ||
| } | ||
|
|
||
| func Inc() { | ||
| foo.count++ | ||
| } | ||
|
|
||
| const foo.name = "xgo" | ||
| var foo.count int = 100 |
This file contains hidden or 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,14 @@ | ||
| package main | ||
|
|
||
| type foo int | ||
|
|
||
| const XGos_foo_Name = "xgo" | ||
|
|
||
| func Name() string { | ||
| return XGos_foo_Name | ||
| } | ||
| func Inc() { | ||
| XGos_foo_Count++ | ||
| } | ||
|
|
||
| var XGos_foo_Count int = 100 |
This file contains hidden or 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 @@ | ||
| const foo.name = "xgo" | ||
| var foo.count int = 100 | ||
|
|
||
| type foo int | ||
|
|
||
| a := foo.name | ||
| foo.count++ |
This file contains hidden or 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 @@ | ||
| package main | ||
|
|
||
| const XGos_foo_Name = "xgo" | ||
|
|
||
| type foo int | ||
|
|
||
| var XGos_foo_Count int = 100 | ||
|
|
||
| func main() { | ||
| a := XGos_foo_Name | ||
| XGos_foo_Count++ | ||
| } |
This file contains hidden or 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,11 @@ | ||
| type foo struct { | ||
| name string | ||
| count int | ||
| } | ||
|
|
||
| const foo.name = "static" | ||
| var foo.count int = 100 | ||
|
|
||
| foo := foo{name: "local"} | ||
| a := foo.name | ||
| foo.count++ |
This file contains hidden or 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,16 @@ | ||
| package main | ||
|
|
||
| type foo struct { | ||
| name string | ||
| count int | ||
| } | ||
|
|
||
| const XGos_foo_Name = "static" | ||
|
|
||
| var XGos_foo_Count int = 100 | ||
|
|
||
| func main() { | ||
| foo := foo{name: "local"} | ||
| a := foo.name | ||
| foo.count++ | ||
| } |
This file contains hidden or 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 @@ | ||
| type foo int | ||
|
|
||
| const foo.π = 3 | ||
|
|
||
| a := foo.π |
This file contains hidden or 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 main | ||
|
|
||
| type foo int | ||
|
|
||
| const XGos_foo_Π = 3 | ||
|
|
||
| func main() { | ||
| a := XGos_foo_Π | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be
XGos_Rect_name