Skript

Skript

788k Downloads

Overloaded functions where one argument is a supertype of the other mistakenly errors.

Closed this issue ยท 0 comments

commented

Skript/Server Version

[22:06:28 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[22:06:28 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[22:06:28 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[22:06:28 INFO]: [Skript] Server Version: 1.21.4-222-9b1798d (MC: 1.21.4)
[22:06:28 INFO]: [Skript] Skript Version: 2.12.0 (skriptlang-github)
[22:06:28 INFO]: [Skript] Installed Skript Addons:
[22:06:28 INFO]: [Skript]  - skript-gui v1.3.2 (https://github.com/APickledWalrus/skript-gui)
[22:06:28 INFO]: [Skript]  - SkBee v3.10.0 (https://github.com/ShaneBeee/SkBee)
[22:06:28 INFO]: [Skript]  - skript-reflect v2.6 (https://github.com/SkriptLang/skript-reflect)
[22:06:28 INFO]: [Skript]  - skript-particle v1.3.2 (https://github.com/sovdeeth/skript-particle)
[22:06:28 INFO]: [Skript] Installed dependencies: None

Bug Description

When using 2 overloading functions, one with a supertype of the other, Skript errors saying the function already exists.

Expected Behavior

No error, Skript should be able to differentiate.

Steps to Reproduce

function send_welcome(p: player):
    stop
    
function send_welcome(o: offlineplayer):
    stop

Errors or Screenshots

[22:07:40 INFO]: [Skript] Reloading test.sk...
[22:07:40 INFO]: loaded 2 structures from 'local\test.sk'
[22:07:40 INFO]: Line 4: (local\test.sk)
[22:07:40 INFO]:     Function 'send_welcome' with the same argument types already exists in script 'local\test.sk'.
[22:07:40 INFO]:     Line: function send_welcome(o: offlineplayer):
[22:07:40 INFO]:
[22:07:40 INFO]:     Encountered 1 error while reloading test.sk! (4ms)

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.