mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Fixed generic interference with generic tuples
This commit is contained in:
parent
7e947265da
commit
79c9f5d818
6 changed files with 41 additions and 26 deletions
|
@ -4576,12 +4576,24 @@ namespace IDE
|
|||
dialog.PopupWindow(mMainWindow);
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void SelectConfig(String config)
|
||||
{
|
||||
mMainFrame.mStatusBar.SelectConfig(config);
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void SelectConfig()
|
||||
{
|
||||
mMainFrame.mStatusBar.mConfigComboBox.ShowDropdown();
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void SelectPlatform(String platform)
|
||||
{
|
||||
mMainFrame.mStatusBar.SelectPlatform(platform);
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void SelectPlatform()
|
||||
{
|
||||
|
@ -4887,6 +4899,7 @@ namespace IDE
|
|||
return (mTestManager != null);
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
protected void RunTests(bool includeIgnored, bool debug)
|
||||
{
|
||||
if (mOutputPanel != null)
|
||||
|
|
|
@ -1015,7 +1015,7 @@ namespace IDE
|
|||
return true;
|
||||
|
||||
if ((!ScriptManager.sActiveManager.mIsBuildScript) && (gApp.AreTestsRunning()))
|
||||
return true;
|
||||
return false;
|
||||
|
||||
if (gApp.mDebugger.HasPendingDebugLoads())
|
||||
return false;
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace IDE.ui
|
|||
MarkDirty();
|
||||
}
|
||||
|
||||
void SelectPlatform(String platformName)
|
||||
public void SelectPlatform(String platformName)
|
||||
{
|
||||
mPlatformComboBox.Label = platformName;
|
||||
gApp.mPlatformName.Set(platformName);
|
||||
|
|
|
@ -395,6 +395,24 @@ bool BfGenericInferContext::InferGenericArgument(BfMethodInstance* methodInstanc
|
|||
return true;
|
||||
}
|
||||
|
||||
if (wantType->IsTuple())
|
||||
{
|
||||
if (argType->IsTuple())
|
||||
{
|
||||
auto wantTupleType = (BfTupleType*)wantType;
|
||||
auto argTupleType = (BfTupleType*)argType;
|
||||
|
||||
if (wantTupleType->mFieldInstances.size() == argTupleType->mFieldInstances.size())
|
||||
{
|
||||
for (int fieldIdx = 0; fieldIdx < (int)wantTupleType->mFieldInstances.size(); fieldIdx++)
|
||||
{
|
||||
InferGenericArgument(methodInstance, argTupleType->mFieldInstances[fieldIdx].mResolvedType,
|
||||
wantTupleType->mFieldInstances[fieldIdx].mResolvedType, BfIRValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((wantType->IsGenericTypeInstance()) && (wantType->IsUnspecializedTypeVariation()))
|
||||
{
|
||||
auto wantGenericType = (BfTypeInstance*)wantType;
|
||||
|
@ -522,25 +540,7 @@ bool BfGenericInferContext::InferGenericArgument(BfMethodInstance* methodInstanc
|
|||
InferGenericArgument(methodInstance, argInvokeMethod->GetParamType(argIdx), wantInvokeMethod->GetParamType(argIdx), BfIRValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wantType->IsTuple())
|
||||
{
|
||||
if (argType->IsTuple())
|
||||
{
|
||||
auto wantTupleType = (BfTupleType*)wantType;
|
||||
auto argTupleType = (BfTupleType*)argType;
|
||||
|
||||
if (wantTupleType->mFieldInstances.size() == argTupleType->mFieldInstances.size())
|
||||
{
|
||||
for (int fieldIdx = 0; fieldIdx < (int)wantTupleType->mFieldInstances.size(); fieldIdx++)
|
||||
{
|
||||
InferGenericArgument(methodInstance, argTupleType->mFieldInstances[fieldIdx].mResolvedType,
|
||||
wantTupleType->mFieldInstances[fieldIdx].mResolvedType, BfIRValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -18380,11 +18380,6 @@ void BfExprEvaluator::PerformBinaryOperation(BfExpression* leftExpression, BfExp
|
|||
|
||||
void BfExprEvaluator::PerformBinaryOperation(BfExpression* leftExpression, BfExpression* rightExpression, BfBinaryOp binaryOp, BfTokenNode* opToken, BfBinOpFlags flags)
|
||||
{
|
||||
if ((mModule->mCurMethodInstance != NULL) && (mModule->mCurMethodInstance->mMethodDef->mName == "Angle"))
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
|
||||
BfTypedValue leftValue;
|
||||
if (leftExpression != NULL)
|
||||
{
|
||||
|
|
3
IDEHelper/Tests/scripts/Test.txt
Normal file
3
IDEHelper/Tests/scripts/Test.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
RunTests(true, false)
|
||||
SelectPlatform("Win64")
|
||||
RunTests(true, false)
|
|
@ -11,6 +11,10 @@ SETLOCAL EnableDelayedExpansion
|
|||
|
||||
PUSHD %~dp0..\
|
||||
|
||||
@ECHO Testing IDEHelper\Tests\Test.txt in BeefIDE_d
|
||||
%~dp0\RunAndWait %~dp0..\IDE\dist\BeefIDE_d.exe -platform=Win32 -proddir=%~dp0..\IDEHelper\Tests%TESTPATH% -test=scripts\Test.txt
|
||||
@IF !ERRORLEVEL! NEQ 0 GOTO:EOF
|
||||
|
||||
@SET TESTPATH=IDE\Tests\CompileFail001
|
||||
@CALL :TEST
|
||||
@IF !ERRORLEVEL! NEQ 0 GOTO HADERROR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue