summaryrefslogtreecommitdiff
path: root/Source/Dafny/Resolver.ssc
diff options
context:
space:
mode:
authorGravatar kyessenov <unknown>2010-07-02 22:49:03 +0000
committerGravatar kyessenov <unknown>2010-07-02 22:49:03 +0000
commitea0e6d0776c219acbd4af0345038f89bd49bc328 (patch)
tree3895b699e9704b52f20805744652dccec500c957 /Source/Dafny/Resolver.ssc
parent57d26deffedd6434639afe709458548c2534af98 (diff)
Dafny: Support class type parameters in refinements. Added another regression test -- a sequence refined by a singly linked list.
Diffstat (limited to 'Source/Dafny/Resolver.ssc')
-rw-r--r--Source/Dafny/Resolver.ssc8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Dafny/Resolver.ssc b/Source/Dafny/Resolver.ssc
index 3c206066..96ae33c6 100644
--- a/Source/Dafny/Resolver.ssc
+++ b/Source/Dafny/Resolver.ssc
@@ -173,7 +173,6 @@ namespace Microsoft.Dafny {
}
decl.Refined = (ClassDecl!) a;
// TODO: copy over remaining members of a
- // TODO: extend with type parameters for refinements
}
}
@@ -469,6 +468,13 @@ namespace Microsoft.Dafny {
}
void ResolveTypeParameters(List<TypeParameter!>! tparams, bool emitErrors, TypeParameter.ParentType! parent) {
+ // push type arguments of the refined class
+ if (parent is ClassRefinementDecl) {
+ ClassDecl refined = ((ClassRefinementDecl)parent).Refined;
+ assert refined != null;
+ ResolveTypeParameters(refined.TypeArgs, false, refined);
+ }
+
// push non-duplicated type parameter names
foreach (TypeParameter tp in tparams) {
if (emitErrors) {