auto kind{AnalyzeKindParam(context, x.kind, defaultKind)};
if (letterKind.has_value() && kind != *letterKind) {
context.Say(
- "explicit kind parameter on real constant disagrees with exponent letter"_en_US);
+ "explicit kind parameter on real constant disagrees with "
+ "exponent letter"_en_US);
}
auto result{common::SearchTypes(
RealTypeVisitor{kind, x.real.source, context.GetFoldingContext()})};
context.Say(name, "type parameter is not INTEGER"_err_en_US);
} else {
context.Say(name,
- "type parameter inquiry must be applied to a designator"_err_en_US);
+ "type parameter inquiry must be applied to "
+ "a designator"_err_en_US);
}
} else if (dtSpec == nullptr || dtSpec->scope() == nullptr) {
context.Say(name,
if (exprContext_.context().warnOnNonstandardUsage() &&
*thisLen != *constantLength_) {
exprContext_.Say(
- "Character literal in array constructor without explicit type has different length than earlier element"_en_US);
+ "Character literal in array constructor without explicit "
+ "type has different length than earlier element"_en_US);
}
if (*thisLen > *constantLength_) {
- // Language extension (TODO pmk document)
+ // Language extension: use the longest literal to determine the
+ // length of the array constructor's character elements, not the
+ // first, when there is no explicit type.
*constantLength_ = *thisLen;
type_->length = std::move(xType.length);
}
}
} else {
exprContext_.Say(
- "Values in array constructor must have the same declared type when no explicit type appears"_err_en_US);
+ "Values in array constructor must have the same declared type "
+ "when no explicit type appears"_err_en_US);
}
} else {
if (auto cast{ConvertToType(*type_, std::move(*x))}) {
values_.Push(std::move(*cast));
} else {
exprContext_.Say(
- "Value in array constructor could not be converted to the type of the array"_err_en_US);
+ "Value in array constructor could not be converted to the type "
+ "of the array"_err_en_US);
}
}
}
bool inserted{exprContext_.AddAcImpliedDo(name, kind)};
if (!inserted) {
exprContext_.SayAt(name,
- "Implied DO index is active in surrounding implied DO loop and cannot have the same name"_err_en_US);
+ "Implied DO index is active in surrounding implied DO loop "
+ "and cannot have the same name"_err_en_US);
}
std::optional<Expr<IntType>> lower{
GetSpecificIntExpr<IntType::kind>(exprContext_, bounds.lower)};
integer, kind :: k
integer :: m
end type type2
- type, abstract :: abstract(j)
- integer, kind :: j
- integer :: n
- end type abstract
type :: privaten(j)
integer, kind :: j
integer, private :: n
subroutine type2arg(x)
type(type2(0,0)), intent(in) :: x
end subroutine type2arg
- subroutine abstractarg(x)
- type(abstract(0)), intent(in) :: x
- end subroutine abstractarg
subroutine errors
call type1arg(type1(0)())
call type1arg(type1(0)(1))
call type1arg(type1(0)(n=1))
!ERROR: Keyword 'bad' is not a component of this derived type
call type1arg(type1(0)(bad=1))
- !ERROR: Unexpected value in structure constructor
- call type1arg(type1(0)(1,2))
call type2arg(type2(0,0)(n=1,m=2))
call type2arg(type2(0,0)(m=2))
call type2arg(type2(0,0)(type1=type1(0)(n=1),m=2))
call type2arg(type2(0,0)(type1=type1(0)(),m=2))
- !ERROR: ABSTRACT type cannot be used in a structure constructor
- call abstractarg(abstract(0)(n=1))
end subroutine errors
end module module1