Skip to content

Warn about _start override for user exports. #2273

@spotandjake

Description

@spotandjake

Should we be doing a check here and warn and override if a user _start exists?

Originally posted by @spotandjake in #2234 (comment)

Currently if compile:

module Main

provide let _start = () => void

you will get an error propagated from binaryen that _start already exists, unless you compile with --use-start-section we should probably just wrap this with a nicer error. I think we want todo this directly in write_universal_exports or compcore as we only want to apply this on the emitted module. The only slightly annoying / tricky part is in order to use our regular error handler we would need to depend on Location from Grain_Parsing.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions