Opened 10 years ago

Closed 3 years ago

#9 closed defect (fixed)

Disallow unboxed data being present in function closures.

Reported by: benl Owned by:
Priority: normal Milestone:
Component: Core Type Checker Version: 0.1.2
Keywords: Cc:

Description (last modified by benl)

The runtime system doesn't support unboxed data being present in closures. We should check this in core and give a suitable error message.

This program

main () 
 = putStr $ show $ fun () ()

fun ()
 = do	dude	= 100#
	(\t -> dude + 100#)

Causes:

./test/Broken-skip/T9-UnboxedDataInClosures/Main.ddc.c: In function ‘Main_main’:
./test/Broken-skip/T9-UnboxedDataInClosures/Main.ddc.c:43: warning: assignment makes integer from pointer without a cast
./test/Broken-skip/T9-UnboxedDataInClosures/Main.ddc.c:44: warning: passing argument 2 of ‘Data_Function__symDl’ makes pointer from integer without a cast
./test/Broken-skip/T9-UnboxedDataInClosures/Main.ddc.c: In function ‘Main_fun’:
./test/Broken-skip/T9-UnboxedDataInClosures/Main.ddc.c:79: warning: assignment makes pointer from integer without a cast
ddc: PANIC in Main.Invoke
        invokeSeaCompiler: compilation of C file failed.
            pathC = ./test/Broken-skip/T9-UnboxedDataInClosures/Main.ddc.c

Change History (9)

comment:1 Changed 10 years ago by benl

  • Version set to 0.1.2

comment:2 Changed 10 years ago by benl

Test is T9-UnboxedDataInClosures

comment:3 Changed 7 years ago by benl

  • Milestone 0.1.4 deleted

Milestone 0.1.4 deleted

comment:4 Changed 7 years ago by benl

  • Priority changed from minor to normal

comment:5 Changed 7 years ago by benl

  • Milestone set to 0.3.0

comment:6 Changed 7 years ago by benl

  • Milestone changed from 0.3.0 to 0.4.0

We won't implement partial application until 0.4.0

comment:7 Changed 5 years ago by benl

  • Description modified (diff)
  • Milestone 0.4.0 deleted

comment:8 Changed 3 years ago by benl

Language now longer has explicit unboxed types, so this can no longer happen. All variables free in a closure are boxed. Unboxed values are only every introduced during the unboxing conversion when converting Tetra to Salt.

comment:9 Changed 3 years ago by benl

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.