warning XS0436: The type 'Functions' in '' conflicts with the imported type....

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

warning XS0436: The type 'Functions' in '' conflicts with the imported type....

Post by wriedmann »

Hi Robert,
this message is a followup to this message:

https://www.xsharp.eu/forum/suggestions ... t=20#13811

I'm working on another WPF/Core dialect application, and have again this warning:

Code: Select all

warning XS0436: The type 'Functions' in '' conflicts with the imported type 'Functions' in 'rdm.AdsSql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f5ab4fed2162a981'. Using the type defined in ''.	16,2	Start.prg	bnAngebotsTool.XStartupCode:Start
Is there anything I can do to suppress that warning?

I have that in all my applications where I'm using a similar startup code to detect startup errors:

Code: Select all

using System.Diagnostics
using System.Runtime.InteropServices

class bnAngebotsTool.XStartupCode

[STAThreadAttribute];
static method Start as void
	local oSB			as System.Text.StringBuilder

	try

	Functions.Start()

	catch oEx as Exception

	AllocConsole()
	oSB			:= System.Text.StringBuilder{}
	Output( oSB, "An unhandled exception has occurred" )
	Output( oSB, "===================================" )
	do while oEx != null
		Output( oSB, "Exception: " + oEx:Message )
		Output( oSB, "Callstack:")
		Output( oSB, oEx:StackTrace )
		Output( oSB, "" )
		oEx				:= oEx:InnerException
	enddo
	Output( oSB, "===================================" )
	Output( oSB, "Press return to close the application" )
	Wait()
	System.IO.File.AppendAllText( System.IO.Path.Combine( AppDomain.CurrentDomain:BaseDirectory, "ApplicationError.log" ), oSB:ToString() )

	end try

	return

static method Output( oSB as System.Text.StringBuilder, cText as string ) as void

	oSB:AppendLine( cText )
	Console.WriteLine( cText )

	return

static method Wait() as void

	Console.ReadLine()

	return

[DllImport("kernel32.dll", SetLastError := true)];
[return: MarshalAs(UnmanagedType.Bool)];
static extern method AllocConsole() as logic

[DllImport("user32.dll", CharSet := CharSet.Ansi)];
static method MessageBox(hwnd as IntPtr, lpText as string, lpCaption as string, uType as dword) as int pascal

end class

[STAThreadAttribute];
function Start() as int
	local oApp as App

	try

	oApp 		:= App{}

	oApp:Run()

	catch oException as System.Exception

	rdm.WPFLib.WPFUtility.DisplayException( oException )

	end try

	return 0
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

warning XS0436: The type 'Functions' in '' conflicts with the imported type....

Post by robert »

Wolfgang,

Can you try this:
Create a Helper function Named MyStart() with the following contents:

[STAThreadAttribute];
function MyStart() as int
return Start()

and then inside the Start method call MyStart() (do not prefix it with "Functions.")

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

warning XS0436: The type 'Functions' in '' conflicts with the imported type....

Post by wriedmann »

Hi Robert,
thank you very much, that works.
Il will now implement it in all my WPF applications where I have that warning (at least a dozen.....)
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply