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

Changing opaque type to abstract type #3990

Merged
merged 18 commits into from
May 19, 2023

Conversation

davidcok
Copy link
Collaborator

Changing the ambiguous terminology 'opaque type' to 'abstract type'

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

@davidcok davidcok enabled auto-merge (squash) May 11, 2023 03:52
@davidcok davidcok requested a review from RustanLeino May 17, 2023 14:28
Copy link
Collaborator

@RustanLeino RustanLeino left a comment

Choose a reason for hiding this comment

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

Very good!

@@ -204,7 +204,7 @@ declared identifier.

Add(ErrorId.p_misplaced_ellipsis_in_newtype,
@"
There are limitations on refining a newtype, namely that the base type cannot be changed. You can change an opaque type into a newtype, however.
There are limitations on refining a newtype, namely that the base type cannot be changed. You can change an abstract type into a newtype, however.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This reads very nice with "abstract type" instead of "opaque type".

@@ -2371,7 +2371,7 @@ public UserDefinedType(TypeParameter tp)

/// <summary>
/// This constructor constructs a resolved type parameter (but shouldn't be called if "tp" denotes
/// the .TheType of an opaque type -- use the (OpaqueType_AsParameter, OpaqueTypeDecl, List(Type))
/// the .TheType of an abstract type -- use the (AbstractType_AsParameter, AbstractTypeDecl, List(Type))
Copy link
Collaborator

Choose a reason for hiding this comment

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

This entire parenthetic remark is stale and can be deleted. (The .TheType field and OpaqueType_AsParameter thing went away several years ago.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Edited

@@ -8296,17 +8296,17 @@ public ForceCheckToken(IToken tok)
}
}

Bpl.Expr trTypeParamOrOpaqueType(TopLevelDecl x, List<Type>/*?*/ tyArguments = null) {
Contract.Requires(x is TypeParameter || x is OpaqueTypeDecl);
Bpl.Expr trTypeParamOrAbstractType(TopLevelDecl x, List<Type>/*?*/ tyArguments = null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please capitalize trTypeParamOrAbstractType to TrTypeParamOrAbstractType, since you're editing it anyway. And while you're at it, would you mind also renaming method nameTypeParam to NameTypeParam just above it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed both

@MikaelMayer
Copy link
Member

This is an excellent renaming, thanks for thinking about it and implementing it !

@davidcok davidcok merged commit 76dcc6b into dafny-lang:master May 19, 2023
@davidcok davidcok deleted the cok-opaque-type branch May 20, 2023 00:20
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.

3 participants