HighTechTalks DotNet Forums  

Internal Compiler Error

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss Internal Compiler Error in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Reshma
 
Posts: n/a

Default Internal Compiler Error - 04-23-2004 , 02:36 AM






I am getting the following error while trying to compile a J# file

Internal Compiler Error: f:\dd\vjsharp\sdk\bjdev\compiler\vjsc\codegen\attr ibute.cpp(219):

Can any one help m
Thanks

The code file is

// <Snippet1
import System.*
import System.Collections.*
import System.IO.*
import System.Xml.Serialization.*

public class Group
/* Set the element name and namespace of the XML element
By applying an XmlElementAttribute to an array, you instruc
the XmlSerializer to serialize the array as a series of XM
elements, instead of a nested set of elements. *

/** @attribute XmlElement(ElementName = "Members", Namespace = "http://www.cpandl.com"
* *
public Employee Employees[]

/** @attribute XmlElement(DataType = "double", ElementName = "Building"
* *
public double GroupID

/** @attribute XmlElement(DataType = "hexBinary"
* *
public ubyte HexBytes[]


/** @attribute XmlElement(DataType = "boolean"
* *
public boolean IsActive

/** @attribute XmlElement(Type = Manager.class
* *
public Employee Manager

/** @attribute XmlElement(int.class, ElementName = "ObjectNumber"
* @attribute XmlElement(String.class, ElementName = "ObjectString"
* *
public ArrayList ExtraInfo
} //Grou

public class Employee
public String Name
} //Employe

public class Manage
extends Employee
public int Level
} //Manage

public class Run

public static void main(String[] args)
Run test = new Run()
test.SerializeObject("FirstDoc.xml")
test.DeserializeObject("FirstDoc.xml")
} //mai



public void SerializeObject(String filename)
// Create the XmlSerializer
XmlSerializer s = new XmlSerializer(Group.class.ToType())

// To write the file, a TextWriter is required
TextWriter writer = new StreamWriter(filename)

/* Create an instance of the group to serialize, and se
its properties. *
Group group = new Group()
group.GroupID = 10.089
group.IsActive = false

group.HexBytes = new ubyte[]{Convert.ToByte(100)}

Employee x = new Employee()
Employee y = new Employee()

x.set_Name("Jack")
y.set_Name("Jill")

group.Employees = new Employee[]{x, y}

Manager mgr = new Manager()
mgr.set_Name("Sara")
mgr.Level = 4
group.Manager = mgr

/* Add a number and a string to the
ArrayList returned by the ExtraInfo property. *
group.ExtraInfo = new ArrayList()
group.ExtraInfo.Add(42)
group.ExtraInfo.Add("Answer")

// Serialize the object, and close the TextWriter.
s.Serialize(writer, group)
writer.Close()
} //SerializeObjec


public void DeserializeObject(String filename)
FileStream fs = new FileStream(filename, FileMode.Open)
XmlSerializer x = new XmlSerializer(Group.class.ToType())
Group g = ((Group)(x.Deserialize(fs)))
Console.WriteLine(g.Manager.get_Name())
Console.WriteLine(g.GroupID)
Console.WriteLine(g.HexBytes.get_Item( 0))
for(int iCtr =0;iCtr < g.Employees.length;iCtr++

Employee e = g.Employees[iCtr]
Console.WriteLine(e.get_Name())

} //DeserializeObjec
} //Ru

// </Snippet1>

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: Internal Compiler Error - 09-08-2004 , 06:54 AM






This issue has been fixed in Visual Studio .NET 2005 - currently its in
Beta1.

Note that you need to access the fields in the class Employee as x.Name and
not as x.get_Name() or x.set_Name; as "Name" is a field and not a property.

Thanks,
Diganta Roy
Microsoft Visual J# .NET Product Team

This posting is provided "AS IS" with no warranties, and confers no
rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

--------------------
Quote:
Reply-To: "Lars-Inge Tønnessen" <http://emailme.larsinge.com
From: "Lars-Inge Tønnessen" <http://emailme.larsinge.com
References: <98E31D6E-A45B-45CF-8459-99B6C5327602 (AT) microsoft (DOT) com
Subject: Re: Internal Compiler Error
Date: Tue, 27 Apr 2004 16:37:40 +0200
Lines: 160
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
Message-ID: <eJGEFVGLEHA.2976 (AT) TK2MSFTNGP10 (DOT) phx.gbl
Newsgroups: microsoft.public.dotnet.vjsharp
NNTP-Posting-Host: stud-064.vpn.uit.no 129.242.154.197
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP10
.phx.gbl
Quote:
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.vjsharp:5964
X-Tomcat-NG: microsoft.public.dotnet.vjsharp


Can any one help me

I can make it work. Please see " // HERE____" in your code. Now it compiles
and runs.


This line gives you the internal error:

/** @attribute XmlElement(Type = Manager.class) * */
public Employee Manager;

Change it to:

/** @attribute XmlElement(Manager.class, ElementName = "Manager") */
public Employee Manager;


You have a few extra problems too I corrected for you. =)



import System.*;
import System.Collections.*;
import System.IO.*;
import System.Xml.Serialization.*;

public class Group
{
/** @attribute XmlElement(ElementName = "Members", Namespace =
http://www.cpandl.com) */
public Employee Employees[];

/** @attribute XmlElement(DataType = "double", ElementName =
"Building")
*/
public double GroupID;

/** @attribute XmlElement(DataType = "hexBinary") */
public ubyte HexBytes[];
/** @attribute XmlElement(DataType = "boolean") */
public boolean IsActive;

// HERE_____________
/** @attribute XmlElement(Manager.class, ElementName = "Manager") */
public Employee Manager;
// _________________

/** @attribute XmlElement(int.class, ElementName = "ObjectNumber")
* @attribute XmlElement(String.class, ElementName = "ObjectString") */
public ArrayList ExtraInfo;
} //Group

public class Employee
{
public String Name;
} //Employee

public class Manager extends Employee
{
public int Level;
} //Manager

public class Runq
{
public void SerializeObject(String filename)
{

// Create the XmlSerializer.
XmlSerializer s = new XmlSerializer(Group.class.ToType());

// To write the file, a TextWriter is required.
TextWriter writer = new StreamWriter(filename);

/* Create an instance of the group to serialize, and set its
properties. */
Group group = new Group();
group.GroupID = 10.089;
group.IsActive = false;
group.HexBytes = new ubyte[]{Convert.ToByte(100)};
Employee x = new Employee();
Employee y = new Employee();


// HERE_______
x.Name = new String("Jack");
y.Name = new String("Jill");
// ___________

group.Employees = new Employee[]{x, y};
Manager mgr = new Manager();

// HERE _____
mgr.Name = new String("Sara");
// __________

mgr.Level = 4;
group.Manager = mgr;

/* Add a number and a string to the ArrayList returned by the
ExtraInfo property. */
group.ExtraInfo = new ArrayList();

// HERE________
group.ExtraInfo.Add( (System.Int32)(42) );
group.ExtraInfo.Add("Answer");
// ____________

// Serialize the object, and close the TextWriter.

// HERE____
try
{
s.Serialize(writer, group);
writer.Close();
}
catch ( System.InvalidOperationException invalid )
{
System.Console.WriteLine( "Exception: "+invalid);
}
// _______


} //SerializeObject

public void DeserializeObject(String filename)
{
FileStream fs = new FileStream(filename, FileMode.Open);
XmlSerializer x = new XmlSerializer(Group.class.ToType());
Group g = ((Group)(x.Deserialize(fs)));
Console.WriteLine(g.Manager.Name);
Console.WriteLine(g.GroupID);
Console.WriteLine(g.HexBytes.get_Item( 0));
for(int iCtr =0;iCtr < g.Employees.length;iCtr++)
{
Employee e = g.Employees[iCtr];


// HERE______
Console.WriteLine(e.Name);
// __________

}
} //DeserializeObject


public static void main(String[] args)
{
Runq test = new Runq();
test.SerializeObject("FirstDoc.xml");
test.DeserializeObject("FirstDoc.xml");
}
}



Regards,
Lars-Inge Tønnessen
www.larsinge.com





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.