From ca297162d5416a8c7b8af5f27757900d82d3ad03 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 12 Nov 2017 23:49:34 -0400 Subject: - Fixed some bugs. - Improved error reporting. - Optimized pattern-matching a bit. --- new-luxc/source/luxc/lang/analysis/function.lux | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'new-luxc/source/luxc/lang/analysis/function.lux') diff --git a/new-luxc/source/luxc/lang/analysis/function.lux b/new-luxc/source/luxc/lang/analysis/function.lux index 627fb7c0a..5a6df4d3e 100644 --- a/new-luxc/source/luxc/lang/analysis/function.lux +++ b/new-luxc/source/luxc/lang/analysis/function.lux @@ -102,10 +102,14 @@ (&;with-stacked-errors (function [_] (Cannot-Apply-Function (format " Function: " (%type funcT) "\n" - "Arguments: " (|> args (list/map %code) (text;join-with " "))))) + "Arguments:" (|> args + list;enumerate + (list/map (function [[idx argC]] + (format "\n " (%n idx) " " (%code argC)))) + (text;join-with ""))))) (do meta;Monad - [expected meta;expected-type + [expectedT meta;expected-type [applyT argsA] (&inference;apply-function analyse funcT args) _ (&;with-type-env - (tc;check expected applyT))] + (tc;check expectedT applyT))] (wrap (la;apply argsA funcA))))) -- cgit v1.2.3