- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
(1) The snippet below gives an internal compiler error. I can also create variants of it that would give a 'catastrophic error' by using the procedure pointer component of a type pointing to procedure of another type.
(2) I accidently noticed that if "contains" statement is omitted/commented-out in the module that has a type definition with type-bound procedure, the compiler gives error as "end statement confusion". If a type bound procedure is not there, the diagnostic correctly points to Subroutine (or Function) line with message "This statement is positioned incorrectly". I think the latter is better since, at least, it gives the correct location of the error.
Abhi
====
Module myType
Implicit None
Type newObject
Integer :: i
Contains
Procedure :: Method
End Type newObject
Contains
Subroutine Method(Object, r)
Implicit None
Class(newObject) :: Object
Real :: r
End Subroutine Method
End Module myType
Program Test_Procedure
Use myType
Implicit None
Type(newObject) :: Object
Procedure(), Pointer :: Dummy
Dummy => Object%Method
End Program Test_Procedure
(1) The snippet below gives an internal compiler error. I can also create variants of it that would give a 'catastrophic error' by using the procedure pointer component of a type pointing to procedure of another type.
(2) I accidently noticed that if "contains" statement is omitted/commented-out in the module that has a type definition with type-bound procedure, the compiler gives error as "end statement confusion". If a type bound procedure is not there, the diagnostic correctly points to Subroutine (or Function) line with message "This statement is positioned incorrectly". I think the latter is better since, at least, it gives the correct location of the error.
Abhi
====
Module myType
Implicit None
Type newObject
Integer :: i
Contains
Procedure :: Method
End Type newObject
Contains
Subroutine Method(Object, r)
Implicit None
Class(newObject) :: Object
Real :: r
End Subroutine Method
End Module myType
Program Test_Procedure
Use myType
Implicit None
Type(newObject) :: Object
Procedure(), Pointer :: Dummy
Dummy => Object%Method
End Program Test_Procedure
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - we'll investigate. Issue is DPD200139701
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page