Commit Graph

150 Commits

Author SHA1 Message Date
Zahary Karadjov
c1f1f84194 fix some regressions caused by tyTypeDesc[tyNone] 2014-02-15 20:44:01 +02:00
Araq
cc0a32ae87 Merge branch 'devel' of https://github.com/Araq/Nimrod into devel 2014-02-06 00:27:10 +01:00
Araq
d912d18379 tyTypeDesc and tyRange always have 1 child; this might be tyNone but it is required for skipTypes 2014-02-05 23:43:13 +01:00
Charlie Barto
7cfec91057 deleted assert that would never fire because it turned into an error message 2014-02-04 00:07:17 -05:00
Charlie Barto
51076a0be6 added good error for stuff like string[int] or int[int] 2014-02-03 23:54:01 -05: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
a6a18be089 support for parametric user-defined type classes 2014-01-24 14:13:32 +02:00
Araq
73c6efdf66 'nil' as a statement is deprecated, use an empty 'discard' instead 2014-01-19 16:54:59 +01:00
Zahary Karadjov
1ffae7cbaf progress towards fixing tgenericshardcases 2014-01-06 00:15:55 +02:00
Zahary Karadjov
789ba107cf introduce tyFromExpr; fixes #618 2014-01-04 13:10:52 +02:00
Zahary Karadjov
8e0941576f clean-up some obsolete code; close #602 2013-12-31 12:39:43 +02:00
Zahary Karadjov
754e2ef1db migrate the static param handling to ReplaceTypeVars; fix tgenericvariant 2013-12-30 19:15:41 +02:00
Zahary Karadjov
e3f53409f6 proc redefinition search based on the type system instead of on sloppy AST matching
This will work the same for procs/templates/macros/etc, having arbitrary mix of implicit
and explicit generics (as long as the symbols are equivalent for the purposes of overload
resolution, they will be detected as redefinitions)

fixes tgeneric
2013-12-30 10:57:12 +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
Zahary Karadjov
72291875bf integrate the logic of fixupProcType into ReplaceTypeVars 2013-12-29 16:08:33 +02:00
Araq
b731e6ef1c case consistency: cs:partial bootstraps on windows 2013-12-29 03:19:10 +01:00
Araq
438703f59e case consistency: next steps 2013-12-29 01:13:51 +01:00
Zahary Karadjov
66a2556525 make more tests green 2013-12-29 00:00:37 +02:00
Zahary Karadjov
5d75ce2f2e fix tclosure4 2013-12-28 15:07:30 +02:00
Zahary Karadjov
a59f13b00d lift generic parameters from concrete composite type classes 2013-12-28 12:50:45 +02:00
Araq
92b8fac94a case consistency part 4 2013-12-27 23:10:36 +01:00
Zahary Karadjov
a27eb51535 towards support for composite type classes such as seq[Number] and SquareMatrix[T] 2013-12-27 18:34:28 +02:00
Araq
2df9b442c6 case consistency part 1 2013-12-27 15:48:53 +01:00
Zahary Karadjov
edab4aaad0 better integration of tyStatic into typeRel 2013-12-25 22:29:44 +02:00
Zahary Karadjov
1d02f2ea53 wip type class reforms (the compiler bootstraps fine)
* replace tfAny and tfAll with tyAnd and tyOr
* integrate matchTypeClass into typeRel
* introduce tyBuiltInTypeClass to handle types such as tuple, object, proc, etc
2013-12-25 19:25:04 +02:00
Zahary Karadjov
299cefdc98 make the current PContext accessible through TCandidate
the goal here is to remove all the hacks from ParamTypeMatch and to handle
all type matching in typeRel (the context there is required to evaluate any static
params and to run the compilation tests of user-defined type classes)
2013-12-25 00:58:22 +02:00
Zahary Karadjov
952dbc4b8f documented static params 2013-12-25 00:32:53 +02: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
Zahary Karadjov
31dd66acbf support for multiple test variables and var qualifiers in user-defined type classes 2013-11-13 02:24:08 +02:00
Araq
ac474a2812 'noStackFrame' implies 'naked' in the generated C code 2013-10-06 00:10:45 +02:00
Zahary Karadjov
f05ac0cb23 fix regressions affecting the echo magic and the creating of rod files
the markAndSweep GC was not responsible for the regressions so
this commit restores its use
2013-09-07 11:55:19 +03:00
Zahary Karadjov
6082595e96 Merge branch 'type-classes' into upstream 2013-09-03 03:14:56 +03:00
Araq
b40ab4dc9e fixes #554, fixes #179 2013-08-31 11:49:33 +02:00
Zahary Karadjov
28d9398de7 implemented delegators and improved the error messages of unmatched type classes 2013-08-26 23:29:24 +03:00
Zahary Karadjov
6378fbd66e working code for simple cases of user-defined type classes 2013-08-25 12:17:40 +03:00
Zahary Karadjov
56d75bd23b implemented and documented the new typedesc binding rules 2013-08-23 15:43:27 +03:00
Zahary Karadjov
8682ed9bd0 pass-through of static int generic params to arrays when late instantiation is disabled 2013-08-23 01:10:20 +03:00
Zahary Karadjov
fee2a7ecfa Experimental support for delayed instantiation of generics
This postpones the semantic pass over the generic's body until
the generic is instantiated. There are several pros and cons for
this method and the capabilities that it enables may still be possible
in the old framework if we teach it a few new trick. Such an attempt
will follow in the next commits.

pros:
1) It allows macros to be expanded during generic instantiation that
will provide the body of the generic. See ``tmacrogenerics``.
2) The instantiation code is dramatically simplified. Dealing with unknown
types in the generic's body pre-pass requires a lot of hacky code and error
silencing in semTypeNode. See ``tgenericshardcases``.

cons:
1) There is a performance penalty of roughly 5% when bootstrapping.
2) Certain errors that used to be detected in the previous pre-pass won't
be detected with the new scheme until instantiation.
2013-08-23 01:10:20 +03:00
Zahary Karadjov
3e79e9f981 some steps to improve the type mismatches with the new
generic instantiation logic
2013-08-19 01:45:16 +03:00
Zahary Karadjov
8b933e470e fixes iterating over enums 2013-08-19 01:36:04 +03:00
Zahary Karadjov
c6d0611112 Revert "Revert "made some tests green"" 2013-08-19 01:35:33 +03:00
Zahary Karadjov
f760bc243b Revert "Revert "static and default params for generics""
This reverts commit 0662ec4a43.
2013-08-19 01:29:37 +03:00
Zahary Karadjov
dfb5cb3c5d remerge "Fixes #267" 2013-08-19 01:26:37 +03:00
Araq
731c6f9083 'nimrod pretty' usable 2013-07-31 20:35:04 +02:00
Araq
b1d4dfa6b1 fixes #544 2013-07-24 22:32:09 +02:00
Araq
d4c91bbd85 improvements for 'not nil' checking 2013-06-13 01:40:11 +02:00
Araq
23ef565a3c implemented large parts of the 'not nil' checking 2013-06-09 23:29:43 +02:00
Araq
a8ba628bcd Revert "fixes #267"
This reverts commit 7fccdedcb5.
2013-05-27 23:20:41 +02:00
Araq
0662ec4a43 Revert "static and default params for generics"
This reverts commit 46813bbe4e.
2013-05-27 23:18:38 +02:00