Skip to content

Commit ea576b0

Browse files
Remove redundant declarations. Fix serialization.
1 parent 7023da2 commit ea576b0

File tree

2 files changed

+6
-32
lines changed

2 files changed

+6
-32
lines changed

DotNet.BackEnd.CCI/CciBackEnd.n

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,8 @@ namespace Nitra.BackEnd.Cci
580580

581581
CreateGenericParameter(genericParam : IGenericParameter, context : DependentPropertyEvalContext) : TypeSymbol
582582
{
583-
def name = NRB.Name(NoLocation, genericParam.Name.Value); // TODO: type.Name.UniqueKey
584-
def tps = TypeParameterDeclaration(name, genericParam).DefineSymbol();
583+
def tps = TypeParameterSymbol();
584+
tps.UpdateName(genericParam.Name.Value); // TODO: type.Name.UniqueKey
585585
tps.EvalProperties(context);
586586
tps
587587
}
@@ -625,8 +625,8 @@ namespace Nitra.BackEnd.Cci
625625

626626
MakeArrayTypeParameter(context : DependentPropertyEvalContext) : TypeSymbol
627627
{
628-
def name = NRB.Name(NoLocation, "T");
629-
def tps = ArrayTypeParameterDeclaration(name).DefineSymbol();
628+
def tps = TypeParameterSymbol();
629+
tps.UpdateName("T");
630630
tps.EvalProperties(context);
631631
tps
632632
}
@@ -744,19 +744,6 @@ namespace Nitra.BackEnd.Cci
744744
public Type : INestedTypeDefinition { get; private set; }
745745
}
746746

747-
[Record]
748-
public class TypeParameterDeclaration : ExternalDeclaration[TypeParameterSymbol]
749-
{
750-
public TypeParam : IGenericParameter;
751-
public override CreateSymbol() : DeclarationSymbol { TypeParameterSymbol() }
752-
}
753-
754-
[Record]
755-
public class ArrayTypeParameterDeclaration : ExternalDeclaration[TypeParameterSymbol]
756-
{
757-
public override CreateSymbol() : DeclarationSymbol { TypeParameterSymbol() }
758-
}
759-
760747
[Record]
761748
public class ExternalPropertyDeclaration : ExternalDeclaration[Member.PropertySymbol]
762749
{

Nitra/Nitra.Grammar/AST/DotNet/CompilationUnit.n

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ namespace DotNet
369369
for (mutable i = 0; i < count; ++i)
370370
{
371371
def tp = typarms.Head;
372-
def name = NRB.Name(loc, tp.Name);
373-
def tps = TypeParameterDeclaration(name, tp).DefineSymbol();
372+
def tps = TypeParameterSymbol();
373+
tps.UpdateName(tp.Name);
374374
tps.EvalProperties(context);
375375
result.Add(tps);
376376
typarms = typarms.Tail;
@@ -625,19 +625,6 @@ namespace DotNet
625625
}
626626
}
627627

628-
[Record]
629-
class TypeParameterDeclaration : ExternalDeclaration[TypeParameterSymbol]
630-
{
631-
public NemerleTypeParam : StaticTypeVar;
632-
public override CreateSymbol() : DeclarationSymbol { TypeParameterSymbol() }
633-
}
634-
635-
[Record]
636-
class TypeParameterStubDeclaration : ExternalDeclaration[TypeParameterSymbol]
637-
{
638-
public override CreateSymbol() : DeclarationSymbol { TypeParameterSymbol() }
639-
}
640-
641628
interface IExternalTypeDeclaration
642629
{
643630
NemerleTypeInfo : TypeInfo { get; }

0 commit comments

Comments
 (0)