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:
parent
20af4e2adc
commit
4b7ad7036c
6 changed files with 65 additions and 1 deletions
5
IDE/Tests/BugW007/BeefProj.toml
Normal file
5
IDE/Tests/BugW007/BeefProj.toml
Normal file
|
@ -0,0 +1,5 @@
|
|||
FileVersion = 1
|
||||
|
||||
[Project]
|
||||
Name = "Bug"
|
||||
StartupObject = "Bug.Program"
|
6
IDE/Tests/BugW007/BeefSpace.toml
Normal file
6
IDE/Tests/BugW007/BeefSpace.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
FileVersion = 1
|
||||
Projects = {Bug = {Path = "."}}
|
||||
|
||||
[Workspace]
|
||||
StartupProject = "Bug"
|
||||
|
13
IDE/Tests/BugW007/scripts/Test.txt
Normal file
13
IDE/Tests/BugW007/scripts/Test.txt
Normal 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()
|
29
IDE/Tests/BugW007/src/Program.bf
Normal file
29
IDE/Tests/BugW007/src/Program.bf
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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())
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue