Commit Graph

59 Commits

Author SHA1 Message Date
Zahary Karadjov
8cd5f1f8f5 introduce tyInferred for the unbound concept type params
* Why is tyInferred needed?

The bindings in TCandidate are capable of inferring types within a single
call expression. In concepts, we need to infer types in the same way, but
across the whole body of the concept.

Previously, once a concept type param was inferred, it was destructively
mutated using t.assignType, but this proved to be problematic in the presence
of overloads, because the bindings established while a non-matching overload
is tested must be reverted/forgotten. tyInferred offers a non-destructive way to
keep track of the inference progress.

While introducing new types usually requires a lot of code paths in the compiler
to updated, currently tyInferred is only a short-lived type within the concept body
pass and it's unlikely to introduce breakage elsewhere in the compiler.
2017-03-24 16:58:15 +02:00
Zahary Karadjov
eab1d0cc02 support for accessing the inferred concept type params with the dot operator 2017-03-24 16:58:15 +02:00
Yuriy Glukhov
e213b120ab Fixes #5452 2017-02-28 17:23:25 +02:00
Araq
4c5ecb46b0 fixes a minor codegen issue where name mangling could produce an identifier used by the codegen; refs #5437 2017-02-26 17:41:00 +01:00
Arne Döring
92c2a51bf7 removed compiler internal list implementation (#5371) 2017-02-22 17:33:12 +01:00
Andreas Rumpf
848676cec6 name mangling bugfixes; ndi file generation for debugger support 2017-02-03 09:49:36 +01:00
Andreas Rumpf
fab69661ad new name mangling rules for easier debugging 2017-02-02 16:27:48 +01:00
Araq
e6c5622aa7 removed tyArrayConstr completely from the compiler; introduced tyAlias instead in preparation for further bugfixes 2016-11-14 23:18:30 +01:00
Araq
860cbd3107 signature hashing: more progress 2016-11-11 08:58:42 +01:00
Jacek Sieka
f5c3eb6a25 clean up tyMutable remnants 2016-10-24 23:30:10 +08:00
Jacek Sieka
b3de34548d clean up tyConst remnants 2016-10-24 23:19:46 +08:00
Jacek Sieka
f488ed973d clean up tyBigNum remnants 2016-10-24 23:11:38 +08:00
Jacek Sieka
6f7b891bdc remove remnants of tyIter 2016-10-24 21:10:48 +08:00
Andreas Rumpf
9605435f2e get rid of deprecated toLower/toUpper 2016-07-19 19:28:01 +02:00
Andreas Rumpf
b47d9b7b91 fixes #4371 2016-07-08 10:34:12 +02:00
Araq
36f68e1650 fixes #3329 2015-09-18 02:24:12 +02:00
Araq
ecc0090939 fixes #2551; fixes #2212; breaks bootstrapping in debug mode; bootstrap with -d:release 2015-04-25 23:16:57 +02:00
def
39049e151f Get rid of deprecation warnings 2015-04-07 15:47:18 +02:00
Araq
d61f326f38 prevent name mangling for C++ DLLs 2015-03-05 01:34:09 +01:00
Araq
76e44dd034 test tsets2.nim compiles again 2015-03-01 23:01:02 +01:00
Araq
f4a0400de2 fixes #2199, fixes #2197 2015-02-24 19:19:08 +01:00
Federico Ceratto
c95f6f117a Fix typos 2015-02-15 16:06:06 +00:00
Araq
6004280522 preparations for C++ template support 2015-01-23 00:36:58 +01:00
Araq
e65c296bcc implemented mixed mode codegen 2014-10-03 01:21:35 +02:00
Araq
2781fea9e2 Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
Araq
2f43fdb837 renamefest 2014-08-23 01:43:49 +02:00
Araq
b5248d9037 fixes #1143 2014-08-19 10:01:46 +02:00
Araq
9673e4f2df progress on deepCopy 2014-08-01 23:40:48 +02:00
flaviut
85e6e2a240 Document mangling 2014-05-26 10:44:14 -04:00
flaviut
a568c6102f Make codegen for 1 and similar valid 2014-05-16 19:07:32 -04:00
Zahary Karadjov
f0953db3ba handle arbitrary expressions dependent on static input params in proc signatures 2014-03-16 20:42:06 +02:00
Araq
ed5bbfe36d fixes #968 2014-03-04 08:31:11 +01:00
Zahary Karadjov
3f71b7f1f6 implements #766;
expressions such as Type.field are now recognised by the compiler.
This also fixes a bug, preventing the user-defined to check for the presence of
regular fields in addition to procs
2014-01-24 23:52:52 +02:00
Zahary Karadjov
789ba107cf introduce tyFromExpr; fixes #618 2014-01-04 13:10:52 +02:00
Zahary Karadjov
afddae5aaf Merge branch 'upstream' into devel
Conflicts:
	compiler/ccgutils.nim
	compiler/msgs.nim
	compiler/sem.nim
	compiler/semexprs.nim
	compiler/seminst.nim
	compiler/semmagic.nim
	compiler/semstmts.nim
	compiler/semtypes.nim
	compiler/semtypinst.nim
	compiler/sigmatch.nim
	compiler/types.nim
	compiler/vmgen.nim
	lib/core/macros.nim
	lib/system.nim
	tests/reject/tenummix.nim
	web/news.txt
2013-12-29 17:21:00 +02:00
Araq
92b8fac94a case consistency part 4 2013-12-27 23:10:36 +01:00
Araq
2df9b442c6 case consistency part 1 2013-12-27 15:48:53 +01:00
Zahary Karadjov
027f30610e static params: expr[T] is now static[T]
This introduces tyStatic and successfully bootstraps and handles
few simple test cases.  Static params within macros are no longer
treated as PNimrodNodes - they are now equivalent to constants
of the designated type.
2013-12-19 01:06:38 +02:00
Zahary Karadjov
de3b7cd413 progress towards adding negative type classes
[unittest bugfixes]
the block form of check now allows comments
errors when inspecting the arguments of var-accepting procs
2013-12-09 00:09:03 +02:00
Araq
1c9b4e5d33 made some tests green; implemented 'from module import nil' 2013-05-19 23:17:16 +02:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
Araq
4b0cdc6db7 fixes for the new overloading resolution 2013-03-03 16:35:19 +01:00
Araq
5b0d8246f7 make some tests green 2013-03-03 12:05:03 +01:00
Zahary Karadjov
d0edb1826b adds an option to interleave the generated code with snippets from the original source
Lines from the original source are outputted as comments next to line directives.
Hopefully, this will make debugging codegen problems easier.

Other changes:
The frame setup code now uses a single-line C macro. My motivation was to reduce
the noise in the generated output and make it easier to step over the boiler-plate
code, but counter-intuitively this also improved the overall compilation speed a
little bit so I applied the same treatment to line tracking too (this reduces the size of
the generated files and the explanation is that probably the I/O overhead dominates
the macro expansion costs).
2012-12-02 20:36:29 +02:00
Zahary Karadjov
f9bd8cc985 [caas] first version that actually works (still has a lot of logical memory leaks on recompilation) 2012-11-28 01:15:13 +02:00
Araq
7b4560337b bugfixes for closures 2012-06-21 08:46:56 +02:00
Zahary Karadjov
e2d38a57ec better support for unsigned integers. 2012-06-11 21:38:01 +03:00
Araq
7a249eb8c1 bugfix: field names of tuples are treated consistently in the C backend 2012-05-27 14:57:12 +02:00
Zahary Karadjov
296ef07955 tyOrdinal now means "integral types". tyTypeClass created to take care of type constraints 2012-03-22 16:24:12 +02:00
Araq
78f4aacde9 pragma blocks; fixed line information issue with user defined assertions 2012-01-17 23:58:18 +01:00