View Issue Details

IDProjectCategoryView StatusLast Update
0035591FPCCompilerpublic2019-05-16 14:48
ReporterStephan JaschkeAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version3.0.4Product Build3.0.4 [2018/10/29] for x86_64 
Target VersionFixed in Version 
Summary0035591: Named arguments for invokeable variants may be mixed with positional arguments
DescriptionHello.

Following snippet compiles fine with Fpc and fails with Delphi:

var
  VarTest: Variant;

V := VarTest.Method(1, ArgX := 2, 3, ArgY := 4, 5)

Here positional and named arguments are mixed, but it's impossible to
match the argument names in DispInvoke to the corresponding values.

According to the response of PascalDragon in
https://forum.lazarus.freepascal.org/index.php/topic,45319.0.html
this should not compile.

"Positional arguments must be before named arguments."
Steps To ReproduceA simple program:

program Test;
var
  V, VarTest: Variant;
begin
  V := VarTest.Method(1, ArgX := 2, 3, ArgY := 4, 5)
end.

This should NOT compile!
Tagsvariants
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

Marco van de Voort

2019-05-16 14:48

manager   ~0116218

Afaik this is the case in VB too.

Issue History

Date Modified Username Field Change
2019-05-16 13:58 Stephan Jaschke New Issue
2019-05-16 14:06 Stephan Jaschke Tag Attached: variants
2019-05-16 14:48 Marco van de Voort Note Added: 0116218