Skip to content

Commit dcc170f

Browse files
borkdudeswannodette
authored andcommitted
CLJS-3466: support qualified method in return position
1 parent 9f77604 commit dcc170f

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

src/main/clojure/cljs/analyzer.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4141,7 +4141,7 @@
41414141
{:op :qualified-method
41424142
:env env
41434143
:form sym
4144-
:class (analyze-symbol env (symbol sym-ns))}
4144+
:class (analyze-symbol (assoc env :context :expr) (symbol sym-ns))}
41454145
(if (= "new" sym-name)
41464146
{:kind :new
41474147
:name (symbol sym-name)}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; Copyright (c) Rich Hickey. All rights reserved.
2+
; The use and distribution terms for this software are covered by the
3+
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
4+
; which can be found in the file epl-v10.html at the root of this distribution.
5+
; By using this software in any fashion, you are agreeing to be bound by
6+
; the terms of this license.
7+
; You must not remove this notice, or any other, from this software.
8+
9+
(ns cljs.qualified-method-test
10+
(:refer-global :only [String])
11+
(:require [cljs.test :as test :refer-macros [deftest testing is]]))
12+
13+
(deftest qualified-method-return-position-test
14+
(testing "qualified method returned from function to force it in return position"
15+
(let [f (fn [] String/.toUpperCase)
16+
m (f)]
17+
(is (= "FOO" (m "foo"))))))

src/test/cljs/lite_test_runner.cljs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
;; You must not remove this notice, or any other, from this software.
88

99
(ns lite-test-runner
10-
(:require [cljs.proxy-test]
10+
(:require [cljs.qualified-method-test]
11+
[cljs.proxy-test]
1112
[cljs.test :refer-macros [run-tests]]
1213
[cljs.apply-test]
1314
[cljs.primitives-test]
@@ -73,6 +74,7 @@
7374
(enable-console-print!))
7475

7576
(run-tests
77+
'cljs.qualified-method-test
7678
'cljs.proxy-test
7779
'cljs.apply-test
7880
'cljs.primitives-test

src/test/cljs/test_runner.cljs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
;; You must not remove this notice, or any other, from this software.
88

99
(ns test-runner
10-
(:require [cljs.proxy-test]
10+
(:require [cljs.qualified-method-test]
11+
[cljs.proxy-test]
1112
[cljs.test :refer-macros [run-tests]]
1213
[cljs.apply-test]
1314
[cljs.primitives-test]
@@ -72,6 +73,7 @@
7273
(enable-console-print!))
7374

7475
(run-tests
76+
'cljs.qualified-method-test
7577
'cljs.proxy-test
7678
'cljs.apply-test
7779
'cljs.primitives-test

0 commit comments

Comments
 (0)