summary refs log tree commit diff stats
path: root/compiler/semobjconstr.nim
Commit message (Expand)AuthorAgeFilesLines
* Fix tests/types/tparameterizedparent0Zahary Karadjov2020-04-011-1/+1
* Turn some of the errors back into warningsZahary Karadjov2020-04-011-0/+5
* Replace tfHasRequiresInit with a more accurate mechanismZahary Karadjov2020-04-011-22/+39
* More precise error messages for uninitialized fields in the presence of inher...Zahary Karadjov2020-04-011-35/+25
* Turn the warning for uninitialized (result) variables into errorsZahary Karadjov2020-04-011-2/+3
* Plug another hole: default(T) forbidden for objects requiring initializationZahary Karadjov2020-04-011-0/+18
* Don't allow 'var x: T' for objects that require initializationZahary Karadjov2020-04-011-36/+32
* More sophistication; Allow requiresInit to be specified per-fieldZahary Karadjov2020-04-011-11/+21
* First steps, the compiler can boot with enforced requiresInitZahary Karadjov2020-04-011-9/+4
* ARC: optimize complete object constructors to use nimNewObjUninitAraq2020-01-261-0/+3
* Better case coverage error message for alias and range enum (#12913)Jasper Jenkins2019-12-181-47/+9
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-26/+26
* refactoring: --newruntime consists of 3 different switchesAraq2019-10-201-1/+1
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-1/+1
* Consider range type of runtime discrim [feature] (#11432)Oscar Nihlgård2019-08-201-16/+45
* int128 on firstOrd, lastOrd and lengthOrd (#11701)Arne Döring2019-08-071-1/+1
* fixes #11585Andreas Rumpf2019-07-031-2/+3
* fixes #11617Araq2019-07-011-0/+3
* parameter runtime discriminators (#11397)Jasper Jenkins2019-06-041-3/+6
* fix bool and range (#11336)Jasper Jenkins2019-05-271-4/+6
* Smarter variant object construction (#11273)Jasper Jenkins2019-05-261-14/+93
* special typing rules for owned pointersAndreas Rumpf2019-03-041-2/+5
* WIP: disallow 'nil' for strings and seqsAndreas Rumpf2018-08-131-2/+2
* refactoring: remove idents.legacy global variable and pass the IdentCache aro...Andreas Rumpf2018-05-271-3/+3
* sem pass compiles againAndreas Rumpf2018-05-121-33/+29
* more modules compile againAndreas Rumpf2018-05-121-11/+11
* fixes a regression about static object case variant checkingAraq2018-04-061-1/+3
* further steps in implementing sink parameters; refs #7041Araq2018-03-301-1/+1
* fixes #5450Andreas Rumpf2018-02-041-0/+4
* preparations for language extensions: 'sink' and 'lent' typesAndreas Rumpf2018-01-071-2/+2
* fixes #5999Araq2017-12-141-2/+8
* work in progress: new implementation for 'a[^1]'Andreas Rumpf2017-10-291-6/+9
* deprecated unary '<'Andreas Rumpf2017-10-291-5/+5
* Fixes #5965 (#6237)Daniil Yarancev2017-08-141-1/+6
* move the object construction logic to a separate fileZahary Karadjov2017-04-061-0/+292
"> != low(a): if a >= 0: result = a else: result = -a else: result = low(a) proc `|div|`*(a, b: BiggestInt): BiggestInt = # (0..5) div (0..4) == (0..5) div (1..4) == (0 div 4) .. (5 div 1) if b == 0'i64: # make the same as ``div 1``: result = a elif a == low(a) and b == -1'i64: result = high(result) else: result = a div b proc `|mod|`*(a, b: BiggestInt): BiggestInt = if b == 0'i64: result = a else: result = a mod b proc `|*|`*(a, b: BiggestInt): BiggestInt = var resAsFloat, floatProd: float64 result = a *% b floatProd = toBiggestFloat(a) # conversion floatProd = floatProd * toBiggestFloat(b) resAsFloat = toBiggestFloat(result) # Fast path for normal case: small multiplicands, and no info # is lost in either method. if resAsFloat == floatProd: return result # Somebody somewhere lost info. Close enough, or way off? Note # that a != 0 and b != 0 (else resAsFloat == floatProd == 0). # The difference either is or isn't significant compared to the # true value (of which floatProd is a good approximation). # abs(diff)/abs(prod) <= 1/32 iff # 32 * abs(diff) <= abs(prod) -- 5 good bits is "close enough" if 32.0 * abs(resAsFloat - floatProd) <= abs(floatProd): return result if floatProd >= 0.0: result = high(result) else: result = low(result)