Comments (6)
As they are different types, equality isn't possible (nor is it generally expected of unexported types).
from go.
@seankhliao My point is that they should not be different types, but instead defined using a type alias. For this reason I'm asking this issue to be reopened.
Cc: @tklauser #57237 (comment)
from go.
Change https://go.dev/cl/581655 mentions this issue: encoding/binary: fix NativeEndian to support == with Little/BigEndian
from go.
@seankhliao Please review CL581655 which fixes this issue.
from go.
Cc: @randall77 because #57237 (comment)
from go.
I realize that my TestEqual
in the description is flawed: the bo
is of type binary.ByteOrder
(an interface) so the comparaison happens at runtime.
However for binary.NativeEndian == binary.BigEndian
, the type are resolved at compile time and a mismatch is detected like with binary.LittleEndian == binary.BigEndian
:
invalid operation: binary.LittleEndian == binary.BigEndian (mismatched types binary.littleEndian and binary.bigEndian)
So this issue deserved to be closed.
from go.
Related Issues (20)
- cmd/compile: "panic: unification reached recursion depth limit" with recursive type constraint
- cmd/compile: error message refers to aliased type instead of the alias type name HOT 2
- build: golang.org/x/tools/gopls/internal/test/integration/codelens failures HOT 2
- json: Marshaler with promote HOT 1
- internal/runtime/exithook: allow concurrent os.Exit HOT 1
- cmd/compile: panic: interface conversion: types.Object is nil, not *ir.Name HOT 2
- io: race condition with use of Pipe HOT 10
- os: manually instantiated os.Process methods return EBADF
- cmd/link: crash in testshared HOT 4
- x/tools/gopls: error reporting type as `chan<- invalid type` HOT 3
- x/tools/go/packages: NeedExportFile causes error about invalid go.mod file to be dropped HOT 2
- proposal: runtime: add a way to check if fd is used by go runtime HOT 1
- os: incompatible change to os.FindProcess Pid field
- os: racy use of pidfd HOT 2
- os: Wait can wait on the wrong process
- proposal: strings: add a ReplaceRange function HOT 9
- x/tools/go/packages: pass overlay to all invocations of `go list`
- x/tools/gopls: Cannot navigate to function on MacOS when the go file is Windows OS specific.
- os/exec: Cmd.Wait Cmd.StderrPipe data-loss race condition go1.22.3 240525 darwin-arm64 14.5 HOT 4
- runtime: SIGSEGV after performing clone(CLONE_PARENT) via C constructor prior to runtime start [1.22 backport] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go.