"un"def Types lazarus / 64-FPC development ---------------------------------------------------------------------- paule32 · 2022-12-21 11:14 Hello, is it possible to "un"def given Types ? I would try to compile a system.pas unit, and the fpc compiler tells me, that SmallInt is dupplicated. Here is the line: type Smallint = -32768..32767; How can I "un"def SmallInt, if exists, and when yes, then re-type it. Thanks for reading ---------------------------------------------------------------------- PascalDragon · 2022-12-22 06:45 You can't because SmallInt is an internal type provided by the compiler itself. ---------------------------------------------------------------------- Thaddy · 2022-12-22 07:05 What is your purpose? ---------------------------------------------------------------------- Leledumbo · 2022-12-30 03:17 Not for system unit. Elsewhere, you can override it while still referring to the system unit one by fully qualified name. The compiler has internal type definitions (about 8 or so) that cannot be changed without changing the compiler (system unit alone is not enough). ---------------------------------------------------------------------- circular · 2023-01-14 07:19 You could redefine the type so that it cannot be used. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type Smallint = record end; var a: Smallint; begin  a := 3; // compile time errorend; ---------------------------------------------------------------------- Thaddy · 2023-01-14 08:28 Quote from: circular on January 14, 2023, 08:19:42 amYou could redefine the type so that it cannot be used. Yes, anywhere BUT the system unit! Everything for which the compiler inserts code is in system.fpd. None of that can be controlled by you unless you rewrite the compiler. Examine rtl\inc\system.fpd for what you can't do yourself. Note changing the fpd file does not help, it is documentation only. See the header:'This File contains extra, phony declarations used in fpdoc" Btw, it is still not clear to me how OP wants to redefine the smallint type. There may be other ways to introduce a type with a different range. The best thing I could come up with is ranges by significant bits in power of two's: ranges: 2              range  Boolean; 4              range -2..1 8              range -4..3 16            range -8..7 32            range -16..15 64            range -32..31 128          range -64..63 256          range  shortint 512          range -256..255 1024        range -512..511 2048        range -1024..1023 4096        range -2048..2047 8192        range -4096..4095 16384      range -8096..8095 32768      range -16384..16383    65536      range SmallInt Well, if I am right, invent some names for the types and write a full set of operators for them.... Like I did for ternary values -1..1. ---------------------------------------------------------------------- VisualLab · 2023-01-15 19:35 Quote from: Thaddy on January 14, 2023, 09:28:24 amLike I did for ternary values -1..1. Did it have to do with the TValueSign type?