comparison src/elaborate.sml @ 1717:16ee7ff7f119

Avoid kindof failures in elaboration
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Apr 2012 13:57:10 -0400
parents 1584fd8d16dd
children 0bafdfae2ac7
comparison
equal deleted inserted replaced
1716:05ae68e019b6 1717:16ee7ff7f119
1 (* Copyright (c) 2008-2011, Adam Chlipala 1 (* Copyright (c) 2008-2012, Adam Chlipala
2 * All rights reserved. 2 * All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met: 5 * modification, are permitted provided that the following conditions are met:
6 * 6 *
391 NONE => (conError env (UnboundStrInCon (loc, m)); 391 NONE => (conError env (UnboundStrInCon (loc, m));
392 (strerror, sgnerror)) 392 (strerror, sgnerror))
393 | SOME sgn => ((L'.StrProj (str, m), loc), sgn)) 393 | SOME sgn => ((L'.StrProj (str, m), loc), sgn))
394 ((L'.StrVar n, loc), sgn) ms 394 ((L'.StrVar n, loc), sgn) ms
395 395
396 val k = case E.projectCon env {sgn = sgn, str = str, field = s} of 396 val (c, k) = case E.projectCon env {sgn = sgn, str = str, field = s} of
397 NONE => (conError env (UnboundCon (loc, s)); 397 NONE => (conError env (UnboundCon (loc, s));
398 kerror) 398 (cerror, kerror))
399 | SOME (k, _) => k 399 | SOME (k, _) => elabConHead env (L'.CModProj (n, ms, s), loc) k
400 val (c, k) = elabConHead env (L'.CModProj (n, ms, s), loc) k
401 in 400 in
402 (c, k, []) 401 (c, k, [])
403 end) 402 end)
404 403
405 | L.CApp (c1, c2) => 404 | L.CApp (c1, c2) =>