# Chapter 2 - about checking type

**URL:** <https://forums.kodeco.com/t/chapter-2-about-checking-type/171913>\
**Category:** Dart Apprentice\
**Created:** [May 26, 2022, 4:59am UTC](https://forums.kodeco.com/t/chapter-2-about-checking-type/171913 "2022-05-26T04:59:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lauragales](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/lauragales/32/110821_2.png) [@lauragales](https://forums.kodeco.com/u/lauragales)\
**Post date:** [May 26, 2022, 12:03pm UTC](https://forums.kodeco.com/t/chapter-2-about-checking-type/171913/2 "2022-05-26T12:03:33Z")

</div>

> [@ellery](#):
>
> What’s going on inside? If I remove the condition, the code even not compile.

The next chapter (_3_) will cover this. The `num` type could be a `double` at runtime, so the static analysis/compiler will preemptively complain. When you enclose the statement in a conditional block with the `is` type test operator, to test for an `int`, the compiler can affirm `.isEven` function will be called on an `int` value

`num` is for numeric values whose types are not known at compile time. It can store a `int` or `double`

The `num` type is derived from `Object`  
The `int` and `double` types are derived from `num`, so they all belong to it.

```auto
num someNumber = 3;
print(someNumber is Object); // True for all values in Dart
print(someNumber is num); // True
print(someNumber is int); // True
print(someNumber.runtimeType); // int

```

---

_[View the full topic](https://forums.kodeco.com/t/chapter-2-about-checking-type/171913)._
