Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/compiler/typechecker/typechecker.sml
ViewVC logotype

Diff of /trunk/src/compiler/typechecker/typechecker.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 89, Thu May 27 01:37:21 2010 UTC revision 91, Thu May 27 15:16:36 2010 UTC
# Line 103  Line 103 
103    (* resolve overloading: we use a simple scheme that selects the first operator in the    (* resolve overloading: we use a simple scheme that selects the first operator in the
104     * list that matches the argument types.     * list that matches the argument types.
105     *)     *)
106      fun resolveOverload (rator, argTys, args, candidates) = let      fun resolveOverload (cxt, rator, argTys, args, candidates) = let
107            fun tryCandidates [] = raise Fail(concat[            fun tryCandidates [] = err(cxt, [
108                    "unable to resolve overloaded operator \"", Atom.toString rator, "\""                    S "unable to resolve overloaded operator \"", A rator, S "\"\n",
109                      S "  argument type is: ", TYS argTys, S "\n"
110                  ])                  ])
111              | tryCandidates (x::xs) = let              | tryCandidates (x::xs) = let
112                  val (tyArgs, Ty.T_Fun(domTy, rngTy)) = Util.instantiate(Var.typeOf x)                  val (tyArgs, Ty.T_Fun(domTy, rngTy)) = Util.instantiate(Var.typeOf x)
# Line 166  Line 167 
167                                  S "  but found: ", TYS[ty1, ty2], S "\n"                                  S "  but found: ", TYS[ty1, ty2], S "\n"
168                                ])                                ])
169                          end                          end
170                      | ovldList => resolveOverload (rator, [ty1, ty2], [e1', e2'], ovldList)                      | ovldList => resolveOverload (cxt, rator, [ty1, ty2], [e1', e2'], ovldList)
171                    (* end case *)                    (* end case *)
172                  end                  end
173              | PT.E_UnaryOp(rator, e) => let              | PT.E_UnaryOp(rator, e) => let
# Line 184  Line 185 
185                                  S "  but found: ", TY ty, S "\n"                                  S "  but found: ", TY ty, S "\n"
186                                ])                                ])
187                          end                          end
188                      | ovldList => resolveOverload (rator, [ty], [e'], ovldList)                      | ovldList => resolveOverload (cxt, rator, [ty], [e'], ovldList)
189                    (* end case *)                    (* end case *)
190                  end                  end
191              | PT.E_Tuple args => let              | PT.E_Tuple args => let

Legend:
Removed from v.89  
changed lines
  Added in v.91

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0