Skip to main content

RedeclaredType

rascal-0.40.17

Synopsis

A type with the same name has been declared before.

Description

Some declarations introduce new type names. Most important are an algebraic data type and alias. This error signals that the same type name is used for incompatible purposes.

Remedy: rename one of the type names.

Examples

rascal>data D = d(int x);
ok
rascal>alias D = str;
|prompt:///|(0,14,<1,0>,<1,14>): Illegal re-declaration of type: D
Advice: |https://www.rascal-mpl.org/docs/Rascal/Errors/CompileTimeErrors/RedeclaredType|
ok
rascal>alias D = int;
ok
rascal>alias D = str;
|prompt:///|(0,14,<1,0>,<1,14>): Illegal re-declaration of type: D
Advice: |https://www.rascal-mpl.org/docs/Rascal/Errors/CompileTimeErrors/RedeclaredType|
ok