Snowball Docs
SocialsContributeTry out online!Standard Library
  • ๐Ÿ‘‹Welcome to snowball!
  • Overview
    • ๐ŸˆWhy Snowball
    • โœจLanguage Features
  • fundamentals
    • ๐Ÿ› ๏ธGetting started
    • ๐Ÿ“Installation
      • โ€ผ๏ธCommon install issues
    • ๐Ÿ‘ถHello world!
  • language reference
    • ๐ŸŒGlobal Scope
    • ๐Ÿค–Functions
      • ๐ŸฃBasic syntax
      • ๐Ÿ˜ตFunction Generics
      • โ“External functions
      • ๐Ÿ”งFunction Attributes
      • ๐Ÿ’ขLLVM Functions
      • ๐ŸšชProgram Entries
    • ๐ŸŽญTypes
      • ๐Ÿ”ขPrimitive types
      • ๐Ÿ”€Reference types
      • โ˜๏ธPointer types
      • ๐Ÿ”“Mutability
      • โ‰๏ธType generics
      • ๐Ÿ”–Type aliases
      • ๐ŸšฏUnknown pointer type (void pointers)
    • ๐Ÿ”„Casting
      • ๐Ÿ”Mutability casting
      • ๐ŸฆบDynamic casting
      • ๐Ÿ‘จโ€๐ŸŽ“Type conversions
    • ๐Ÿ—๏ธClasses
      • ๐Ÿ’ผMembers
      • ๐Ÿ”’Access qualifiers
      • ๐Ÿ›‘Final classes
      • ๐ŸงAbstract classes
    • ๐Ÿ”Access qualifiers
    • โš’๏ธMacros
      • โœจBuiltin macros
    • ๐Ÿ”ซUnsafe snowball
    • ๐Ÿ˜ดGenerics
    • ๐ŸŒณCode Flow
      • โ˜๏ธIf statements
    • ๐Ÿ“ฆModules
      • ๐Ÿ‘‰Using Statement
  • snowball cli usage
    • ๐Ÿ’ปCLI usage and parameters
    • ๐ŸงชTesting mode
  • Confy
    • โš™๏ธGetting Started
    • ๐ŸˆSnowball's Schema
  • Reky Package Manager
    • ๐Ÿ“ฆGetting Started
  • coding style
    • ๐Ÿ’…The desired standard
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. language reference

Casting

In Snowball, casting refers to the process of converting a value from one type to another. It allows you to explicitly change the interpretation or representation of data to match a different type. Casting is useful when you need to perform operations that require compatible types or when you want to ensure proper type compatibility. Here are the casting mechanisms available in Snowball:

let a = myInteger as f32; // 'a' has a type of f32 now

This type of casting is used to explicitly convert a value to a specified target type. The target type must be compatible with the original value, ensuring proper type conversion. Casting to parent types is allowed, while casting to child types requires the use of dyn_cast<...>(...) to perform dynamic type checking.

PreviousUnknown pointer type (void pointers)NextMutability casting

Last updated 1 year ago

Was this helpful?

๐Ÿ”„