Skip to content

Instantly share code, notes, and snippets.

@devboy
Created November 21, 2011 23:38
Show Gist options
  • Save devboy/1384355 to your computer and use it in GitHub Desktop.
Save devboy/1384355 to your computer and use it in GitHub Desktop.
type inference basics
var x; // type of x is Unknown
x = "I'm a String"; // type of x is set to String
x = 1; // this will cause a compiler error as Int cannot be assigned to String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment