cmd/compile: streamline pragma checks for TypeDecl#64076
cmd/compile: streamline pragma checks for TypeDecl#64076aimuz wants to merge 1 commit intogolang:masterfrom
Conversation
Simplify the handling of pragmas in type declarations within noder/writer.go. Remove redundant checks by calling checkPragmas once at the beginning of case *syntax.TypeDecl and eliminate unnecessary else block. Also, ensure unique ID assignment for function-scoped defined types is only performed when n.Alias is false. Fixes a redundancy issue where pragma checks were performed inside both branches of an if-else statement unnecessarily. Update golang#46731
|
This PR (HEAD: cd66b5a) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/541739. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/541739. |
|
Message from Jes Cok: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/541739. |
|
Message from qiulaidongfeng: Patch Set 2: Code-Review+1 Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/541739. |
|
Message from Gopher Robot: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/541739. |
|
Message from Gopher Robot: Patch Set 2: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/541739. |
|
Message from Aimuz me: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/541739. |
|
Message from Jes Cok: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/541739. |
|
Message from Jes Cok: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/541739. |
|
Message from Aimuz me: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/541739. |
Simplify the handling of pragmas in type declarations within
noder/writer.go. Remove redundant checks by calling checkPragmas once at
the beginning of case *syntax.TypeDecl and eliminate unnecessary else block.
Also, ensure unique ID assignment for function-scoped defined types is only
performed when n.Alias is false.
Fixes a redundancy issue where pragma checks were performed inside both
branches of an if-else statement unnecessarily.
For #46731