From 34dae82b484cd59067aeb102feb643da83cba2be Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Fri, 22 Apr 2011 11:23:49 -0700 Subject: Add a session field to ty_ctxt and change an err to span_err I changed instantiate to print out a more helpful error message, which required passing it a session argument. To avoid threading extra arguments through a lot of functions, I added a session field to ty_ctxt. --- src/comp/middle/ty.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/comp/middle/ty.rs') diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index f5cea365..47442f2b 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -46,7 +46,7 @@ type mt = rec(t ty, ast.mutability mut); // Contains information needed to resolve types and (in the future) look up // the types of AST nodes. -type ctxt = rec(@type_store ts); +type ctxt = rec(@type_store ts, session.session sess); type ty_ctxt = ctxt; // Needed for disambiguation from Unify.ctxt. // Convert from method type to function type. Pretty easy; we just drop @@ -200,7 +200,7 @@ fn mk_type_store() -> @type_store { others=map.mk_hashmap[t,t](hasher, eqer)); } -fn mk_ctxt() -> ctxt { ret rec(ts=mk_type_store()); } +fn mk_ctxt(session.session s) -> ctxt { ret rec(ts=mk_type_store(), sess=s); } // Type constructors -- cgit v1.2.3