6 ms·
I could be wrong but I don’t think dart has ints, I think it only has objects.
by eklavya 5y ago
I could be wrong but I don’t think dart has ints, I think it only has objects.
- Someone 5y agohttps://api.dart.dev/stable/2.6.0/dart-core/int-class.html https://api.dart.dev/stable/2.6.0/dart-core/int-class.html: “Classes cannot extend, implement, or mix in int.” https://api.dart.dev/stable/2.6.0/dart-core/num-class.html https://api.dart.dev/stable/2.6.0/dart-core/num-class.html: “It is a compile-time error for any type other than int or double to attempt to extend or implement num.” ⇒ it seems that, technically, you’re right. int is an object in Dart. At the same time, it’s a restricted type of object. So restricted that I think it is aan object only in name/at compile time.