From 072b57b44df4fd1d512cca59fa678c4f16671e31 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Tue, 25 Nov 2014 16:28:05 +0000 Subject: Fix bug in FunctionCall that caused the ExprTypeChecking.FunctionCall() unit test to fail. The issue was that one of FunctionCall constructors created a new IdentifierExpr without associating a type with it. To fix this we now set the type of the IdentifierExpr to the return type of the Function passed into the constructor. --- Source/Core/AbsyExpr.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/Core') diff --git a/Source/Core/AbsyExpr.cs b/Source/Core/AbsyExpr.cs index 4c590ddb..c157c50f 100644 --- a/Source/Core/AbsyExpr.cs +++ b/Source/Core/AbsyExpr.cs @@ -1770,6 +1770,10 @@ namespace Microsoft.Boogie { Contract.Requires(f != null); this.Func = f; this.name = new IdentifierExpr(Token.NoToken, f.Name); + + // We need set the type of this IdentifierExpr so ShallowType() works + Debug.Assert(f.OutParams.Count > 0); + this.name.Type = f.OutParams[0].TypedIdent.Type; } public string/*!*/ FunctionName { get { -- cgit v1.2.3