Created
November 21, 2011 23:38
-
-
Save devboy/1384355 to your computer and use it in GitHub Desktop.
type inference basics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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