Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Move Resolver.{TypeSubstitutionMap, SubstType} #3057

Merged
merged 7 commits into from
Nov 23, 2022

Conversation

RustanLeino
Copy link
Collaborator

@RustanLeino RustanLeino commented Nov 15, 2022

This PR just moves two type-related utility methods from Resolver:

  • Resolver.SubstType -> abstract instance method Type.Subst
  • Resolver.TypeSubstitutionMap -> TypeParameter.SubstitutionMap

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Source/DafnyCore/AST/TypeUtil.cs Outdated Show resolved Hide resolved
Source/DafnyCore/AST/TypeUtil.cs Outdated Show resolved Hide resolved
@RustanLeino RustanLeino changed the title refactor: Move Resolver.{TypeSubstitutionMap, SubstType} to TypeUtil refactor: Move Resolver.{TypeSubstitutionMap, SubstType} Nov 23, 2022
@RustanLeino RustanLeino enabled auto-merge (squash) November 23, 2022 04:24
@@ -1183,6 +1183,9 @@ public abstract class ResolverType : Type {
public override bool ComputeMayInvolveReferences(ISet<DatatypeDecl>/*?*/ visitedDatatypes) {
return false;
}
public override Type Subst(Dictionary<TypeParameter, Type> subst) {
throw new NotImplementedException();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think NotSupportedException would be more accurate. NotImplementedException indicates there's work left to do.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Since this PR was already auto-merged, I will incorporate this change in PR #3056, which had triggered this one.

@@ -1749,6 +1754,10 @@ public abstract class ArtificialType : Type {
// ArtificialType's are used only with numeric types.
return false;
}

public override Type Subst(Dictionary<TypeParameter, Type> subst) {
throw new NotImplementedException();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think NotSupportedException would be more accurate. NotImplementedException indicates there's work left to do.

@RustanLeino RustanLeino merged commit 7bd0495 into dafny-lang:master Nov 23, 2022
@RustanLeino RustanLeino deleted the TypeUtil branch November 23, 2022 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants