Well, we should probably tweak the compiler to get it to work.

-Alex

From: Serkan Taş <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Thursday, October 18, 2018 at 1:16 PM
To: "[email protected]" <[email protected]>
Subject: int.MAX_VALUE in function list

Hi,

When i am compiling class with method below i get compile error :

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = 
int.MAX_VALUE):void
    {
        activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Error:

D:\dev\royale-emulation-works\apache-royale-0.9.4-bin-js-swf\royale-asjs\frameworks\projects\SparkRoyale\src\main\royale\spark\components\TextArea.as(753):
 col: 80 Parameter initializer unknown or is not a compile-time constant. An 
initial value of undefined will be used instead.

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = 
int.MAX_VALUE):void



When change as below, compiles correctly.

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = 
0/*int.MAX_VALUE*/):void
    {
        var activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Can we say that int.MAX_VALUE usage in function signature not allowed ?

Thanks
Serkan

Reply via email to