Page MenuHomeFeedback Tracker

typedef unrelated error
Closed, ResolvedPublic

Description

typedef int int1;
array<int> arr = new array<int1>(); //Compile error - Types 'array<int1>' and 'array<int>' are unrelated

:(

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

Armor created this task.Jan 27 2025, 8:13 PM
Geez changed the task status from New to Need More Info.Jan 29 2025, 11:06 AM
Geez added a subscriber: Geez.

Hello Armor.
Can you please provide more details?

Armor added a comment.Jan 29 2025, 5:46 PM

Is this how it is intended that the data type and its alias are unrelated to each other?

more examples:

typedef int int1;
typedef int int2;
typedef int int3;
typedef int int4;
typedef string myString;

// Case 1
map<int1, int2> myMap = new map<int3, int4>(); // Compile Error - Types 'map<int3,int4>' and 'map<int1,int2>' are unrelated


//Case 2
Param1<int1> p = new Param1<int2>(1); // Compile Error - Types 'Param1<int2>' and 'Param1<int1>' are unrelated

//Case 3
myString inputStr = "";
GetGame().ConfigGetText("whatever", inputStr); //Compile Error - Cannot convert 'myString' to 'string' for argument '1' to method 'ConfigGetText'

but my custom function works fine

myString inputStr = "";
GetSomeValueChecked(inputStr); // no errors

bool GetSomeValueChecked(out string str)
{
	str = "some data";
	return true;
}
Geez changed the task status from Need More Info to Assigned.Jan 30 2025, 10:48 AM
Geez closed this task as Resolved.Feb 14 2025, 4:57 PM
Geez claimed this task.