Skip to content
Merged

Dev #1762

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,15 @@ public static BoundExpression GetVODefaultParameter(this ParameterSymbol param,
if (arg.Type.SpecialType == SpecialType.None)
{
// Enum type? can be casted to Int32
constant = ConstantValue.Create(arg.Value, SpecialType.System_Int32);
var netType = compilation.GetSpecialType(SpecialType.System_Int32);
var specialType = SpecialType.System_Int32;
if (param.Type.IsEnumType())
{
var enumUnderlyingType = ((NamedTypeSymbol)param.Type).GetEnumUnderlyingType();
specialType = enumUnderlyingType.SpecialType;

}
var netType = compilation.GetSpecialType(specialType);
constant = ConstantValue.Create(arg.Value, specialType);
return new BoundLiteral(syntax, constant, netType);
}
else
Expand All @@ -114,6 +121,11 @@ public static BoundExpression GetVODefaultParameter(this ParameterSymbol param,
{
specialType = arg.Type.SpecialType;
}
if (param.Type.IsEnumType())
{
var enumUnderlyingType = ((NamedTypeSymbol)param.Type).GetEnumUnderlyingType();
specialType = enumUnderlyingType.SpecialType;
}
if (specialType != valueType)
{
switch (specialType)
Expand Down
4 changes: 3 additions & 1 deletion src/CompilerTests/Applications/C591/Prg/C591.prg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ xAssert(TestNum(u)==123)

u := NULL_OBJECT
TestNum(u)
xAssert(TestNum(u)==123)
// With the vulcan runtime, following returned 123. With the X# runtime, it returns NULL_OBJECT, which is the correct (VO-compatible) behavior
//xAssert(TestNum(u)==123)
xAssert(TestNum(u)==NULL_OBJECT)

u := "asd"
TestNum(u)
Expand Down
Binary file added src/Tools/VOXporter/Dll/XIDE.Base.dll
Binary file not shown.
22 changes: 4 additions & 18 deletions src/Tools/VOXporter/VOXPorter.xsproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,12 @@
<HintPath>Dll\SDK_Defines.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="XICOMMON, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<Name>XICOMMON</Name>
<AssemblyName>XICOMMON.dll</AssemblyName>
<Reference Include="XIDE.Base, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<Name>XIDE.Base</Name>
<AssemblyName>XIDE.Base.dll</AssemblyName>
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
<HintPath>Dll\XICOMMON.dll</HintPath>
</Reference>
<Reference Include="XIDED, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<Name>XIDED</Name>
<AssemblyName>XIDED.dll</AssemblyName>
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
<HintPath>Dll\XIDED.dll</HintPath>
</Reference>
<Reference Include="XIRES, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<Name>XIRES</Name>
<AssemblyName>XIRES.dll</AssemblyName>
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
<HintPath>Dll\XIRES.dll</HintPath>
<HintPath>Dll\XIDE.Base.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
22 changes: 10 additions & 12 deletions src/Tools/VOXporter/VOXporter.viproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ GUID = FD056C5F-6DE1-465A-90E4-0145DEB734D2
IncludeInProjectBuild = 1
IncludeInProjectSearch = 1
IncludeInProjectExport = 1
IncludePath = C:\xSharp\Dev\src\Common
IncludePath =
StdDefsFile =
AppToRun =
SignAssembly = 0
Expand Down Expand Up @@ -98,28 +98,26 @@ File = %AppPath%\VOParser.prg
FileGUID = 81056C36-30B9-42B2-B0F6-E51A9FA52F14
FileType = Code
CopyToBin = 0
File = C:\xSharp\Dev\src\Common\commonAssemblyInfo.prg
File = %ProjectPath%\..\..\Common\commonAssemblyInfo.prg
FileGUID = 3C0D9DC5-C981-4D3A-9A17-0574F88B13E9
FileFileGroup = AA82ABD5-9D0C-4788-976C-3313B139325F
FileType = Code
CopyToBin = 0
File = C:\xSharp\Dev\src\Common\constants.prg
File = %ProjectPath%\..\..\Common\constants.prg
FileGUID = 15B49D79-BAD9-4F74-B42A-DA8B005DF917
FileFileGroup = AA82ABD5-9D0C-4788-976C-3313B139325F
FileType = Code
CopyToBin = 0
[VOXPorter References]
ReferenceGAC = CLR4,System,1,0,4.0.0.0
ReferenceGAC = CLR4,System.Core,1,0,4.0.0.0
ReferenceGAC = CLR4,System.Xml,1,0,4.0.0.0
ReferenceGAC = CLR4,System.Drawing,1,0,4.0.0.0
ReferenceGAC = CLR4,System.Windows.Forms,1,0,4.0.0.0
ReferenceProject = D5679723-DA91-4572-B699-5FDEC084BDB5,1,0,Fab_VO_Entities
ReferenceBrowse = %ProjectPath%\Dll\SDK_Defines.dll,1,1
ReferenceBrowse = %ProjectPath%\Dll\XICOMMON.dll,1,1
ReferenceBrowse = %ProjectPath%\Dll\XIRES.dll,1,1
ReferenceBrowse = %ProjectPath%\Dll\XIDED.dll,1,1
ReferenceGAC = CLR4,System.Core,1,0,4.0.0.0
ReferenceGAC = CLR4,System.Xml,1,0,4.0.0.0
ReferenceBrowse = C:\xSharp\Dev\Artifacts\Common\Debug\XSharp.VoEditors.dll,1,1
ReferenceBrowse = %ProjectPath%\Dll\XIDE.Base.dll,1,1
ReferenceBrowse = %ProjectPath%\..\..\..\Artifacts\Common\Debug\XSharp.VoEditors.dll,1,1
[VOXPorter Resources]
ResourceFile = Designers , %AppPath%\Resources\Designers.resources
ResourceFileGuid = 369B3304-1BF5-4D80-AA97-2B60C561DEDF
Expand Down Expand Up @@ -169,7 +167,7 @@ ModernSyntax=0
NamedArgs=0
InitLocals=0
AllowOldStyleAssignments=0
AllowDotOption=1
AllowDotOption=0
ResponseOnly=0
[VOXPorter Configurations]
AppConfig = Debug,11111111-1111-1111-1111-111111111111
Expand Down Expand Up @@ -227,7 +225,7 @@ GUID = D5679723-DA91-4572-B699-5FDEC084BDB5
IncludeInProjectBuild = 1
IncludeInProjectSearch = 1
IncludeInProjectExport = 1
IncludePath = C:\xSharp\Dev\src\Common
IncludePath =
StdDefsFile =
AppToRun =
SignAssembly = 0
Expand Down Expand Up @@ -349,7 +347,7 @@ ModernSyntax=0
NamedArgs=0
InitLocals=0
AllowOldStyleAssignments=0
AllowDotOption=1
AllowDotOption=0
ResponseOnly=0
[Fab_VO_Entities Configurations]
AppConfig = Debug,11111111-1111-1111-1111-111111111111
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,7 @@ CLASS DBEDesignDBServer INHERIT DesignItem
SELF:AddProperty(oProp)
SELF:AddProperty(VODesignProperty{"caption","Caption","",PropertyType.Text , PropertyStyles.NoAuto})
SELF:AddProperty(VODesignProperty{"description","Description","",PropertyType.Text , PropertyStyles.NoAuto})
SELF:AddProperty(VODesignProperty{"helpcontext","Help Context","",PropertyType.Text , PropertyStyles.NoAuto})

SELF:AddProperty(VODesignProperty{"classname" , "FieldSpec" , "" , PropertyType.Type , PropertyStyles.NoAuto + PropertyStyles.NoNULL})
SELF:AddProperty(VODesignProperty{"superclass" , "Inherit from" , "" , PropertyType.Text , PropertyStyles.NoAuto})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ PARTIAL CLASS VODBServerEditor
cValue := __ReadNextVNDBString(aBytes , REF nPos , 128)
oField:cName := cValue
oField:aProperties:Add("fldname" , cValue)
__ReadNextVNDBString(aBytes , REF nPos , 128)
__ReadNextVNDBString(aBytes , REF nPos , 64)
__ReadNextVNDBString(aBytes , REF nPos , 255)
__ReadNextVNDBString(aBytes , REF nPos , 64)
__ReadNextVNDBString(aBytes , REF nPos , 128) // TODO: what is this for???
oField:aProperties:Add("caption" , __ReadNextVNDBString(aBytes , REF nPos , 64) )
oField:aProperties:Add("description" , __ReadNextVNDBString(aBytes , REF nPos , 255) )
oField:aProperties:Add("helpcontext" , __ReadNextVNDBString(aBytes , REF nPos , 64) )
oField:aProperties:Add("included" , __ReadNextVNDBByte(aBytes , REF nPos):ToString())
m := __ReadNextVNDBInt16(aBytes , REF nPos)
DO WHILE aSorted:ContainsKey(m)
Expand Down