Below was just out of curiosity:
PHP Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo = {
name = "",
author = "",
description = "",
version = "0.0.0",
url = ""
};
int t = 5;
methodmap Test1
{
property int X
{
public get() { return t; }
}
}
methodmap Test2 < Test1
{
property int X
{
public set(int value) { t = value; }
}
}
public void OnPluginStart()
{
Test2 x;
int xt = x.X;
}
Compiler says:
PHP Code:
SourcePawn Compiler 1.8.0-dev+5439
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2015 AlliedModders LLC
plugin.sp(35) : error 149: no getter found for property X
1 Error.
So would ^ count as a compiler bug/not intended(aka NOT suppose to happen)/or working as it should?
Note: Adding the get statement into Test2 does remove compile error.
Edit: This does provide some basic polymorphism on methodmap properties.
Edit2: It seems it also will work on normal methods(non-properties) in methodmaps.