public TacticErrorReportingResolver(CompoundErrorInformation errorInfo) { Contract.Ensures(_errTok != null); Contract.Ensures(_errMessage != null); Contract.Ensures(_tacticCall != null); Contract.Ensures(_activeTactic != null); Contract.Ensures(_callingMember != null); Contract.Ensures(_tmpFailingMember != null); Contract.Ensures(!string.IsNullOrEmpty(_implTargetName)); var proofState = errorInfo.S; var tmpProgram = ((CompoundErrorInformation)errorInfo.E).P; var innerError = ((CompoundErrorInformation)errorInfo.E).E; var tmpModule = (DefaultClassDecl)tmpProgram.DefaultModuleDef.TopLevelDecls.FirstOrDefault(x => x.CompileName == "__default"); var tok = innerError.Tok as NestedToken; _errTok = tok != null ? (Bpl.Token)tok.Inner : (Bpl.Token)innerError.Tok; _errMessage = innerError.FullMsg; _implTargetName = MethodNameFromImpl(innerError.ImplementationName); _tacticCall = proofState.TacticApplication; _activeTactic = proofState.GetTactic(_tacticCall) as Tactic; _callingMember = proofState.TargetMethod; _tmpFailingMember = tmpModule?.Members.FirstOrDefault(x => x.CompileName == _implTargetName); FailingLine = FailingCol = TacticLine = TacticCol = CallingLine = CallingCol = -1; if (!ActiveTacticWasNotUsed()) { ResolveCorrectLocations(); } }
public TacticErrorReportingResolver(CompoundErrorInformation errorInfo) { Contract.Ensures(_errTok != null); Contract.Ensures(_errMessage != null); Contract.Ensures(_tacticCall != null); Contract.Ensures(_activeTactic != null); Contract.Ensures(_callingMember != null); Contract.Ensures(_tmpFailingMember != null); Contract.Ensures(!string.IsNullOrEmpty(_implTargetName)); var proofState = errorInfo.S; var tmpProgram = ((CompoundErrorInformation)errorInfo.E).P; var innerError = ((CompoundErrorInformation)errorInfo.E).E; var tmpModule = (DefaultClassDecl)tmpProgram.DefaultModuleDef.TopLevelDecls.FirstOrDefault(x => x.CompileName== "__default"); var tok = innerError.Tok as NestedToken; _errTok = tok != null ? (Bpl.Token) tok.Inner : (Bpl.Token) innerError.Tok; _errMessage = innerError.FullMsg; _implTargetName = MethodNameFromImpl(innerError.ImplementationName); _tacticCall = proofState.TacticApplication; _activeTactic = proofState.GetTactic(_tacticCall) as Tactic; _callingMember = proofState.TargetMethod; _tmpFailingMember = tmpModule?.Members.FirstOrDefault(x => x.CompileName == _implTargetName); FailingLine = FailingCol = TacticLine = TacticCol = CallingLine = CallingCol = -1; if(!ActiveTacticWasNotUsed()) ResolveCorrectLocations(); }