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

Feature Request: add optional double colon :: #150

Open
e-kwsm opened this issue Apr 28, 2023 · 0 comments
Open

Feature Request: add optional double colon :: #150

e-kwsm opened this issue Apr 28, 2023 · 0 comments

Comments

@e-kwsm
Copy link
Contributor

e-kwsm commented Apr 28, 2023

Consider the following file:

module mymod
   use, intrinsic :: iso_c_binding

   public mytype

   type mytype
   contains
      final destruct
   end type

   enum, bind(C)
      enumerator one
   end enum

   interface myinterface
      module procedure foo
   end interface

contains

   subroutine foo(arg)
      integer arg
      allocatable arg(:)
   end subroutine

   subroutine destruct(self)
      type(mytype) self
   end subroutine
end module

Is it possible to modify it like below?

@@ -3,7 +3,7 @@
 
-   public mytype
+   public :: mytype
 
-   type mytype
+   type :: mytype
    contains
-      final destruct
+      final :: destruct
    end type
@@ -11,3 +11,3 @@
    enum, bind(C)
-      enumerator one
+      enumerator :: one
    end enum
@@ -15,3 +15,3 @@
    interface myinterface
-      module procedure foo
+      module procedure :: foo
    end interface
@@ -21,4 +21,4 @@
    subroutine foo(arg)
-      integer arg
-      allocatable arg(:)
+      integer :: arg
+      allocatable :: arg(:)
    end subroutine
@@ -26,3 +26,3 @@
    subroutine destruct(self)
-      type(mytype) self
+      type(mytype) :: self
    end subroutine

Here double colons are not necessary, though.

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

No branches or pull requests

1 participant