Skip to content

ocall interaction with *warn-on-infer* #21

@aiba

Description

@aiba

Is it expected that ocall should generate a warning when *warn-on-infer* is enabled?

(ns scratch.core
  (:require [oops.core :refer [ocall]]))

(set! *warn-on-infer* true)

(ocall js/document :getElementById "foo")

Produces compiler warning:

  6  (ocall js/document :getElementById "foo")
     ^--- Cannot infer target type in expression (. fn-126930 call (oops.helpers/unchecked-aget call-info-126931 0) "foo")

Perhaps the oops codegen could typehint the fn-* symbol with ^js/Function?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions