-
Notifications
You must be signed in to change notification settings - Fork 262
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
Conversation
There was a problem hiding this 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. |
There was a problem hiding this comment.
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".
Source/DafnyCore/AST/Types/Types.cs
Outdated
@@ -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)) |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed both
This is an excellent renaming, thanks for thinking about it and implementing it ! |
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.