Skip to content

Commit ca5cf92

Browse files
author
cpyrgas
committed
[Compiler tests] Added C908 and C909 for #1475 and #1476
1 parent fb6ebbd commit ca5cf92

File tree

3 files changed

+295
-1
lines changed

3 files changed

+295
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// 908. Internal Compiler Error with duplicate declaring of fields/memvars
2+
// https://github.com/X-Sharp/XSharpPublic/issues/1475
3+
4+
#pragma options (memvar, on)
5+
6+
//memvar+
7+
MEMVAR Foo
8+
PUBLIC Foo
9+
10+
FIELD Bar
11+
MEMVAR Bar
12+
13+
MEMVAR Test
14+
MEMVAR Test
15+
16+
FIELD Another
17+
FIELD Another
18+
19+
20+
FUNCTION Start() AS VOID
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// 909. VFP: Bogus warning when calling a function with /fox2+
2+
// https://github.com/X-Sharp/XSharpPublic/issues/1476
3+
4+
// warning XS9073: Variable 'Test' has not been declared. Assuming this is a FIELD or a MEMVAR.
5+
6+
// /memvar+ /undeclared+ /fox2+
7+
8+
#pragma options (memvar, on)
9+
#pragma options (undeclared, on)
10+
#pragma options (fox2, on)
11+
12+
// warnings as errors set in app properties
13+
// #pragma options (wx, on)
14+
15+
FUNCTION Start() AS VOID
16+
LOCAL u := 123
17+
? Test(u)
18+
? Test(Test(u))
19+
20+
xAssert(u == 123)
21+
xAssert(Test(u) == 123)
22+
xAssert(Test(Test(u)) == 123)
23+
24+
FUNCTION Test(u)
25+
RETURN u
26+
27+
28+
PROC xAssert(l AS LOGIC)
29+
IF l
30+
? "Assertion passed"
31+
ELSE
32+
THROW Exception{"Incorrect result"}
33+
END IF
34+
RETURN

src/CompilerTests/xSharp Tests.viproj

+241-1
Original file line numberDiff line numberDiff line change
@@ -129928,7 +129928,7 @@ AppConfig = Release,22222222-2222-2222-2222-222222222222
129928129928
Optimize=0
129929129929
ENDApplication = C906 - Incorrect Compiler incorrectly resolves static member of another type to SELF property when /allowdot is enabled
129930129930

129931-
ApplicationGroup = B9CFE839-D401-428D-94E9-E9D21E9F772D
129931+
ApplicationGroup = A95A4D23-3574-40FD-B873-22D28ACCA212
129932129932
; ************** APPLICATION C907 - A single comma in a line of code causes an internal compiler error *************
129933129933
Application = C907 - A single comma in a line of code causes an internal compiler error
129934129934
IDEVersion = 1.06
@@ -130044,6 +130044,246 @@ AppConfig = Release,22222222-2222-2222-2222-222222222222
130044130044
ForceX86=0
130045130045
Optimize=0
130046130046
ENDApplication = C907 - A single comma in a line of code causes an internal compiler error
130047+
130048+
ApplicationGroup = B9CFE839-D401-428D-94E9-E9D21E9F772D
130049+
; ************** APPLICATION C908 - Internal Compiler Error with duplicate declaring of fields/memvars *************
130050+
Application = C908 - Internal Compiler Error with duplicate declaring of fields/memvars
130051+
IDEVersion = 1.06
130052+
GalleryName =
130053+
GalleryPage =
130054+
GalleryDefaultName =
130055+
Target = 0
130056+
Platform = AnyCPU
130057+
Language = XSharp
130058+
Runtime = CLR4
130059+
Dialect = VO
130060+
Folder = %ProjectPath%\Applications\C908\
130061+
PrgSubFolder = \Prg
130062+
ResourcesSubFolder =
130063+
Description =
130064+
NameSpace =
130065+
Assembly = C908
130066+
Extension =
130067+
ApplicationIcon =
130068+
OutputFolder =
130069+
Frameworks = 1
130070+
GUID = 59CA2647-568C-4DD7-9181-55A2FDB7B394
130071+
IncludeInProjectBuild = 1
130072+
IncludeInProjectSearch = 1
130073+
IncludeInProjectExport = 1
130074+
IncludePath =
130075+
StdDefsFile =
130076+
AppToRun =
130077+
SignAssembly = 0
130078+
KeyFile =
130079+
130080+
[ExportOptions]
130081+
ExportResources = 0
130082+
ExportImages = 0
130083+
[C908 - Internal Compiler Error with duplicate declaring of fields/memvars FileGroups]
130084+
[C908 - Internal Compiler Error with duplicate declaring of fields/memvars Files]
130085+
File = %AppPath%\Prg\C908.prg
130086+
FileGUID = FF12E4EC-5973-4DB1-B12D-A35B32CC099B
130087+
FileType = Code
130088+
CopyToBin = 0
130089+
[C908 - Internal Compiler Error with duplicate declaring of fields/memvars References]
130090+
ReferenceGAC = CLR4,System,1,0,4.0.0.0
130091+
ReferenceGAC = CLR4,System.Core,1,0,4.0.0.0
130092+
ReferenceGAC = CLR4,XSharp.Core,1,0,2.6.0.0
130093+
ReferenceGAC = CLR4,XSharp.RT,1,0,2.6.0.0
130094+
ReferenceGAC = CLR4,XSharp.VO,1,0,2.6.0.0
130095+
[C908 - Internal Compiler Error with duplicate declaring of fields/memvars Resources]
130096+
[C908 - Internal Compiler Error with duplicate declaring of fields/memvars Native Resources]
130097+
[C908 - Internal Compiler Error with duplicate declaring of fields/memvars License files]
130098+
[C908 - Internal Compiler Error with duplicate declaring of fields/memvars General Options]
130099+
Switches=
130100+
ZeroArrays=0
130101+
CaseSensitive=0
130102+
ImplicitNamespace=0
130103+
VO1=0
130104+
VO2=0
130105+
VO3=0
130106+
VO4=0
130107+
VO5=0
130108+
VO6=0
130109+
VO7=0
130110+
VO8=0
130111+
VO9=0
130112+
VO10=0
130113+
VO11=0
130114+
VO12=0
130115+
VO13=0
130116+
VO14=0
130117+
VO16=0
130118+
VO17=0
130119+
FOX1=0
130120+
FOX2=0
130121+
XPP1=0
130122+
LateBound=0
130123+
Unsafe=0
130124+
Undeclared=0
130125+
EnforceSelf=0
130126+
EnforceOverride=0
130127+
UseNativeVersion=0
130128+
MemVar=0
130129+
IgnoreStdDefs=0
130130+
Ovf=0
130131+
FOvf=0
130132+
ModernSyntax=0
130133+
NamedArgs=0
130134+
InitLocals=0
130135+
AllowOldStyleAssignments=0
130136+
ResponseOnly=0
130137+
[C908 - Internal Compiler Error with duplicate declaring of fields/memvars Configurations]
130138+
AppConfig = Debug,11111111-1111-1111-1111-111111111111
130139+
Switches=
130140+
SwitchesCF=
130141+
CommandLine=
130142+
CommandLineCF=
130143+
Debug=1
130144+
DebugInit=1
130145+
DefineDebug=1
130146+
DefineTrace=0
130147+
SyntaxOnly=0
130148+
WarningsErrors=0
130149+
ForceConsole=0
130150+
ForceX86=0
130151+
Optimize=0
130152+
AppConfig = Release,22222222-2222-2222-2222-222222222222
130153+
Switches=
130154+
SwitchesCF=
130155+
CommandLine=
130156+
CommandLineCF=
130157+
Debug=0
130158+
DebugInit=0
130159+
DefineDebug=0
130160+
DefineTrace=0
130161+
SyntaxOnly=0
130162+
WarningsErrors=0
130163+
ForceConsole=0
130164+
ForceX86=0
130165+
Optimize=0
130166+
ENDApplication = C908 - Internal Compiler Error with duplicate declaring of fields/memvars
130167+
130168+
ApplicationGroup = B9CFE839-D401-428D-94E9-E9D21E9F772D
130169+
; ************** APPLICATION C909 - VFP: Bogus warning when calling a function with /fox2+ *************
130170+
Application = C909 - VFP: Bogus warning when calling a function with /fox2+
130171+
IDEVersion = 1.06
130172+
GalleryName =
130173+
GalleryPage =
130174+
GalleryDefaultName =
130175+
Target = 0
130176+
Platform = AnyCPU
130177+
Language = XSharp
130178+
Runtime = CLR4
130179+
Dialect = FoxPro
130180+
Folder = %ProjectPath%\Applications\C909\
130181+
PrgSubFolder = \Prg
130182+
ResourcesSubFolder =
130183+
Description =
130184+
NameSpace =
130185+
Assembly = C909
130186+
Extension =
130187+
ApplicationIcon =
130188+
OutputFolder =
130189+
Frameworks = 1
130190+
GUID = 6BCEC1B2-A6AC-4CAD-BD8B-1CB9BB55F071
130191+
IncludeInProjectBuild = 1
130192+
IncludeInProjectSearch = 1
130193+
IncludeInProjectExport = 1
130194+
IncludePath =
130195+
StdDefsFile =
130196+
AppToRun =
130197+
SignAssembly = 0
130198+
KeyFile =
130199+
130200+
[ExportOptions]
130201+
ExportResources = 0
130202+
ExportImages = 0
130203+
[C909 - VFP: Bogus warning when calling a function with /fox2+ FileGroups]
130204+
[C909 - VFP: Bogus warning when calling a function with /fox2+ Files]
130205+
File = %AppPath%\Prg\C909.prg
130206+
FileGUID = 2C8AC28C-4266-4BF1-91DF-C4E998155131
130207+
FileType = Code
130208+
CopyToBin = 0
130209+
[C909 - VFP: Bogus warning when calling a function with /fox2+ References]
130210+
ReferenceGAC = CLR4,System,1,0,4.0.0.0
130211+
ReferenceGAC = CLR4,System.Core,1,0,4.0.0.0
130212+
ReferenceGAC = CLR4,XSharp.Core,1,0,2.6.0.0
130213+
ReferenceGAC = CLR4,XSharp.RT,1,0,2.6.0.0
130214+
ReferenceGAC = CLR4,XSharp.VFP,1,0,2.6.0.0
130215+
[C909 - VFP: Bogus warning when calling a function with /fox2+ Resources]
130216+
[C909 - VFP: Bogus warning when calling a function with /fox2+ Native Resources]
130217+
[C909 - VFP: Bogus warning when calling a function with /fox2+ License files]
130218+
[C909 - VFP: Bogus warning when calling a function with /fox2+ General Options]
130219+
Switches=
130220+
ZeroArrays=0
130221+
CaseSensitive=0
130222+
ImplicitNamespace=0
130223+
VO1=0
130224+
VO2=0
130225+
VO3=0
130226+
VO4=0
130227+
VO5=0
130228+
VO6=0
130229+
VO7=0
130230+
VO8=0
130231+
VO9=0
130232+
VO10=0
130233+
VO11=0
130234+
VO12=0
130235+
VO13=0
130236+
VO14=0
130237+
VO16=0
130238+
VO17=0
130239+
FOX1=0
130240+
FOX2=0
130241+
XPP1=0
130242+
LateBound=0
130243+
Unsafe=0
130244+
Undeclared=0
130245+
EnforceSelf=0
130246+
EnforceOverride=0
130247+
UseNativeVersion=0
130248+
MemVar=0
130249+
IgnoreStdDefs=0
130250+
Ovf=0
130251+
FOvf=0
130252+
ModernSyntax=0
130253+
NamedArgs=0
130254+
InitLocals=0
130255+
AllowOldStyleAssignments=0
130256+
ResponseOnly=0
130257+
[C909 - VFP: Bogus warning when calling a function with /fox2+ Configurations]
130258+
AppConfig = Debug,11111111-1111-1111-1111-111111111111
130259+
Switches=
130260+
SwitchesCF=
130261+
CommandLine=
130262+
CommandLineCF=
130263+
Debug=1
130264+
DebugInit=1
130265+
DefineDebug=1
130266+
DefineTrace=0
130267+
SyntaxOnly=0
130268+
WarningsErrors=0
130269+
ForceConsole=0
130270+
ForceX86=0
130271+
Optimize=0
130272+
AppConfig = Release,22222222-2222-2222-2222-222222222222
130273+
Switches=
130274+
SwitchesCF=
130275+
CommandLine=
130276+
CommandLineCF=
130277+
Debug=0
130278+
DebugInit=0
130279+
DefineDebug=0
130280+
DefineTrace=0
130281+
SyntaxOnly=0
130282+
WarningsErrors=0
130283+
ForceConsole=0
130284+
ForceX86=0
130285+
Optimize=0
130286+
ENDApplication = C909 - VFP: Bogus warning when calling a function with /fox2+
130047130287
[EndApplications]
130048130288

130049130289
[Configurations]

0 commit comments

Comments
 (0)