Commit 5449f98b authored by Robert Bradshaw's avatar Robert Bradshaw

Fixed trac-17, default values as class members.

parent 3e0a3b71
...@@ -328,7 +328,7 @@ class Context: ...@@ -328,7 +328,7 @@ class Context:
errors_occurred = True errors_occurred = True
if errors_occurred and result.c_file: if errors_occurred and result.c_file:
try: try:
Utils.castrate_file(result.c_file, os.stat(source)) Utils.castrate_file(result.c_file, os.stat(source.filename))
except EnvironmentError: except EnvironmentError:
pass pass
result.c_file = None result.c_file = None
......
...@@ -790,7 +790,7 @@ class FuncDefNode(StatNode, BlockNode): ...@@ -790,7 +790,7 @@ class FuncDefNode(StatNode, BlockNode):
if arg.default: if arg.default:
if arg.is_generic: if arg.is_generic:
if not hasattr(arg, 'default_entry'): if not hasattr(arg, 'default_entry'):
arg.default.analyse_types(genv) arg.default.analyse_types(env)
arg.default = arg.default.coerce_to(arg.type, genv) arg.default = arg.default.coerce_to(arg.type, genv)
if arg.default.is_literal: if arg.default.is_literal:
arg.default_entry = arg.default arg.default_entry = arg.default
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment