Skip to content

Instantly share code, notes, and snippets.

@momer
Created March 1, 2015 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save momer/84ba224c5f3fbd310b31 to your computer and use it in GitHub Desktop.
Save momer/84ba224c5f3fbd310b31 to your computer and use it in GitHub Desktop.
package myApp;
class ImplementsDynamic
implements Dynamic<String> {
public var present:Int;
public function new() {}
}
package myApp;
// import myApp.ImplementsDynamic;
class Main {
static public function main() {
var c = new myApp.ImplementsDynamic();
// valid, present is an existing field
c.present = 1;
// valid, assigned value is a String
c.stringField = "foo";
// error, Int should be String
// c.intField = 1;
trace(c.stringField);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment