File tree Expand file tree Collapse file tree 2 files changed +46
-6
lines changed Expand file tree Collapse file tree 2 files changed +46
-6
lines changed Original file line number Diff line number Diff line change @@ -137,12 +137,6 @@ Tristate IsDefinedAssignment(
137137 if (!lhsType || !rhsType) {
138138 return Tristate::No; // error or rhs is untyped
139139 }
140- if (lhsType->IsUnlimitedPolymorphic ()) {
141- return Tristate::No;
142- }
143- if (rhsType->IsUnlimitedPolymorphic ()) {
144- return Tristate::Maybe;
145- }
146140 TypeCategory lhsCat{lhsType->category ()};
147141 TypeCategory rhsCat{rhsType->category ()};
148142 if (rhsRank > 0 && lhsRank != rhsRank) {
Original file line number Diff line number Diff line change 1+ ! RUN: %python %S/test_errors.py %s %flang_fc1
2+ module m
3+ type t1
4+ contains
5+ procedure , pass(from) :: defAsst1
6+ generic :: assignment (= ) = > defAsst1
7+ end type
8+ type t2
9+ end type
10+ type t3
11+ end type
12+ interface assignment (= )
13+ module procedure defAsst2
14+ end interface
15+ contains
16+ subroutine defAsst1 (to ,from )
17+ class(* ), intent (out ) :: to
18+ class(t1), intent (in ) :: from
19+ end
20+ subroutine defAsst2 (to ,from )
21+ class(* ), intent (out ) :: to
22+ class(t2), intent (in ) :: from
23+ end
24+ end
25+
26+ program test
27+ use m
28+ type (t1) x1
29+ type (t2) x2
30+ type (t3) x3
31+ j = x1
32+ j = x2
33+ ! ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types INTEGER(4) and TYPE(t3)
34+ j = x3
35+ x1 = x1
36+ x1 = x2
37+ ! ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types TYPE(t1) and TYPE(t3)
38+ x1 = x3
39+ x2 = x1
40+ x2 = x2
41+ ! ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types TYPE(t2) and TYPE(t3)
42+ x2 = x3
43+ x3 = x1
44+ x3 = x2
45+ x3 = x3
46+ end
You can’t perform that action at this time.
0 commit comments