Skip to content

Instantly share code, notes, and snippets.

@devboy
Created November 30, 2011 11:05
Show Gist options
  • Save devboy/1408696 to your computer and use it in GitHub Desktop.
Save devboy/1408696 to your computer and use it in GitHub Desktop.
var point: { x: Int, y: Int };
var pointA3D: { x: Int, y: Int, z: Int } = { x:10, y:10, z:10 };
var pointB3D = { x:10, y:10, z:10 };
point = pointA3D; // this works fine, as the type is set
point = pointB3D; // error: { z : Int, y : Int, x : Int } has extra field z
point = { x:10, y:10, z:10 }; // { z : Int, y : Int, x : Int } has extra field z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment