Fix decorator on functions with defaults

This commit is contained in:
ben
2019-04-06 12:46:48 +13:00
parent 8535ba9a56
commit 7fffc57255
2 changed files with 13 additions and 2 deletions

View File

@@ -585,6 +585,9 @@ impl Compiler {
let was_in_function_def = self.in_function_def;
self.in_loop = false;
self.in_function_def = true;
self.prepare_decorators(decorator_list)?;
let mut flags = self.enter_function(name, args)?;
let (new_body, doc_str) = get_doc(body);
@@ -598,8 +601,6 @@ impl Compiler {
self.emit(Instruction::ReturnValue);
let code = self.pop_code_object();
self.prepare_decorators(decorator_list)?;
// Prepare type annotations:
let mut num_annotations = 0;