Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Overloaded structure constructors get distracted by abstract

$
0
0

I think this has been around for a little while, but the new version prompted me to flush it out.

MODULE MA
  IMPLICIT NONE
  PRIVATE
  PUBLIC :: t
  TYPE :: t
    INTEGER :: comp
  END TYPE t
  INTERFACE t
    MODULE PROCEDURE Make_t
  END INTERFACE t
CONTAINS
  FUNCTION Make_t(arg)
    REAL, INTENT(IN) :: arg
    TYPE(t) :: Make_t
    Make_t%comp = NINT(arg)
  END FUNCTION Make_t
END MODULE MA

PROGRAM PB
  USE MA
  IMPLICIT NONE
  ABSTRACT INTERFACE
    SUBROUTINE s
      USE MA      ! #A comment me out and all is well.
    END SUBROUTINE s
  END INTERFACE
CONTAINS
  SUBROUTINE internal_or_module
    ! USE MA      ! #B comment me in and all is well.
    TYPE(t) :: a
  END SUBROUTINE internal_or_module
END PROGRAM PB

 

>ifort /c /check:all /warn:all /standard-semantics DistractedByAbstract.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.108 Build 20140726
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

DistractedByAbstract.f90(30): error #6463: This is not a derived type name.   [T]
    TYPE(t) :: a
---------^
compilation aborted for DistractedByAbstract.f90 (code 1)

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles