cannot derive from sealed type 'float'

  • Thread starter Thread starter Andrus
  • Start date Start date
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.
 
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
 
Andrus,

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