cannot derive from sealed type 'float'

A

Andrus

I try to compile myGeneration source code using Visual C# Express 2005
Express.

File starts with

using System;
using System.Xml;
using System.Data;
using System.Data.OleDb;

namespace MyMeta
{
public class Table : Single, ITable, INameValueItem
{
public Table()
{

}


compiling causes error in "public class Table line":

MyMeta.Table': cannot derive from sealed type 'float'


This is working code so i expect that code is correct and can be compiled t
can be compiled in some way without changing it.

Why I got compile error ?
How to fix ?

Andrus.
 
H

Hans Kesting

I try to compile myGeneration source code using Visual C# Express 2005
Express.

File starts with

using System;
using System.Xml;
using System.Data;
using System.Data.OleDb;
namespace MyMeta
{
public class Table : Single, ITable, INameValueItem
{
public Table()
{
}

compiling causes error in "public class Table line":

MyMeta.Table': cannot derive from sealed type 'float'

This is working code so i expect that code is correct and can be
compiled t can be compiled in some way without changing it.

Why I got compile error ?
How to fix ?
Andrus.

Do you have your own 'Single' type? The compiler treats the 'Single' you
mention as System.Single, for which 'float' is an alias.
If it is your own type, use the full namespace.

Hans Kesting
 
N

Nicholas Paldino [.NET/C# MVP]

Andrus,

It is not working code. Single (float) is a value type, and they are
sealed, you can not derive from them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top