Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Go
/
Generics
In a constraint, what is the difference between int and ~int?
from Generics
Go 1.27
intermediate
1 min
In a constraint, what is the difference between int and ~int?
int accepts only the predeclared int type; ~int also accepts named types with underlying type int.
~int converts every argument to int at runtime.
~int accepts every numeric type, including floats.
Check
Ask AI about this kata
Report an error
next kata
A Stack[T] method needs to transform values into a new type U. Which declaration is valid…
Quiz
A new version is available
Reload