class Test { static function main() { var struct:Struct = {url: 'www.example.com', method: 'GET'}; var promise:Generic = new Generic({url: struct, method: 'GET'}); } } class Generic { public function new(v:T) {} } typedef Struct = { url:String, method:String, }