1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Dependency fix for elemented types (ie: pointer types)

This commit is contained in:
Brian Fiete 2021-10-24 16:07:12 -07:00
parent 20af4e2adc
commit 4b7ad7036c
6 changed files with 65 additions and 1 deletions

View file

@ -0,0 +1,5 @@
FileVersion = 1
[Project]
Name = "Bug"
StartupObject = "Bug.Program"

View file

@ -0,0 +1,6 @@
FileVersion = 1
Projects = {Bug = {Path = "."}}
[Workspace]
StartupProject = "Bug"

View file

@ -0,0 +1,13 @@
# This tests that renaming namespace properly deletes types
ShowFile("src/Program.bf")
Compile()
Sleep(1000)
GotoText("//Test")
AdjustCursor(-1, 0)
InsertText("2")
Sleep(1000)
Compile()

View file

@ -0,0 +1,29 @@
#pragma warning disable 168
using System;
using System.Collections;
namespace Bug //Test
{
struct Zonkle
{
int mA;
}
class Zorp
{
Dictionary<int, Zonkle*> mDict;
}
}
namespace Bug
{
class Program
{
public static int Main(String[] args)
{
return 0;
}
}
}

View file

@ -3490,7 +3490,14 @@ void BfModule::AddDependency(BfType* usedType, BfType* userType, BfDependencyMap
auto depFlag = flags;
if ((flags & (BfDependencyMap::DependencyFlag_MethodGenericArg | BfDependencyMap::DependencyFlag_TypeGenericArg)) != 0)
depFlag = BfDependencyMap::DependencyFlag_GenericArgRef; // Will cause a rebuild but not an outright deletion of the type
{
if (usedType->IsDependendType())
{
// Cause a rebuild but not an outright deletion of the type
// We can only do this if the 'usedType' can actually hold the dependency which can actually trigger a deletion chain
depFlag = BfDependencyMap::DependencyFlag_GenericArgRef;
}
}
if (!usedType->IsGenericTypeInstance())
{

View file

@ -63,6 +63,10 @@ PUSHD %~dp0..\
@CALL :TEST
@IF !ERRORLEVEL! NEQ 0 GOTO HADERROR
@SET TESTPATH=IDE\Tests\BugW007
@CALL :TEST
@IF !ERRORLEVEL! NEQ 0 GOTO HADERROR
@SET TESTPATH=IDE\Tests\IndentTest
@CALL :TEST
@IF !ERRORLEVEL! NEQ 0 GOTO HADERROR