Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean/comparison not interpreted as "long" in method overloads #678

Open
GWRon opened this issue Nov 11, 2024 · 0 comments
Open

Boolean/comparison not interpreted as "long" in method overloads #678

GWRon opened this issue Nov 11, 2024 · 0 comments

Comments

@GWRon
Copy link
Contributor

GWRon commented Nov 11, 2024

Heya,

Seems passing a "comparison result" as parameter is not interpreting it as int when only method overloads accept "long" (not "int")

SuperStrict
Framework Brl.StandardIO

Type TTest
    Method New(i:Long)
    End Method

    Method New(i:ULong)
    End Method
End Type

Function Func:Int()
    Return 1
End Function

Print (Func() = 2) 'uses "StringFromInt(_m_untitled2_Func()==2)"

'leads to error
Local t:TTest = New TTest(Func()=2)

Results in:

Compile Error: Unable to determine overload to use: Method TTest.New(i:Long) or Method TTest.New(i:ULong).

(when also adding an ":int"-accepting overload, this one is used and no error pops up)

I mentioned this at discord and our fellow coder @HurryStarfish annotated:

...okay nevermind, i tried it out and the blitzmax-ng compiler only complains if you use the comparison as an argument
passing an int literal works

and:

Local arr:Object = [1 = 2]
Print TTypeId.ForObject(arr).Name()
'prints Int[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant