I am looking for early mentions of the accumulation of karma while dreaming.
Here is what I've been able to find so far:
In The Large Sutra on Perfect Wisdom a discussion of accumulating karma in dreams:
Sāriputra: Ven. Subhuti, the Bodhisattva, the great being, who in his dreams enters into the three concentrations—emptiness, the signless, the wishless—does he, then, grow in perfect wisdom?
Subhuti: If, Ven. Śāriputra, he grows through the development by day, then he also grows in a dream. And why? Because dream and waking are indiscriminate. If the Bodhisattva who courses by day in the perfection of wisdom has a development of the perfection of wisdom, then also the Bodhisattva, the great being, who dreams will have a development of the perfection of wisdom.
Śāriputra: If again, Ven. Subhuti, the Bodhisattva, the great being, does a deed in his dream, will there by of that deed a heaping up or accumulation? If all dharmas are said to be like a dream, there will be no heaping up or accumulation of it. And why? Because in a dream no heaping up or accumulation of a dharma can be apprehended. But when one wakes up and thinks it over, then there is a heaping up or accumu- lation of it.
Subhuti: One who had committed a murder in his dream, and, on waking, would think it over like this, 'he has been well killed by me, (A: it is right that he was killed, it is just that he was killed, it was I who killed him!' Such thoughts are equivalent to the conscious notion that he wants to kill someone).
Śāriputra: Not without an objective support does a deed arise or an act of will.
Subhuti: So it is, Śāriputra, not without an objective support does a deed arise or an act of will. Only with an objective support is a deed produced, or an act of will, and not without. In seen, heard, and known dharmas does intelligence proceed, and not in unseen, unheard, unknown dharmas. Therein some intellectual acts take hold of defilement, and some of purification. Therefore, then, Śāriputra, it is with an objective support that a deed or act of will arises and not without objective support.
In Tsongkhapa's Praise for Dependent Relativity it is mentioned that the karma of killing in a dream was a question answered by the Buddha, but no sources are provided.
Shantideva addressed this (or a closely related) question in Chapter 9 of his Guide to the Bodhisattvas Way of Life verse 11 and on:
If consciousness does not exist, there is no sin in killing an illusory person. On the contrary, when one is endowed with the illusion of consciousness, vice and merit do arise.
Sariputra: If someone in his dreams does a deed, wholesome or unwholesome, will that be added on to the heap or collection of his karma?
Subhuti: In so far as the Lord has taught that ultimately all dharmas are like a dream, in so far that deed will not be added to his head or collection of karma. But on the other hand [from the standpoint of empirical reality], that deed will be added to the heap and collection of his karma if, after the man has woken up, he thinks the dream over, and consciously forms the notion that he wants to kill someone. How does he do that? During his dream he may have taken life, and after he has woken up, he thinks it over like this: “it is good that he was killed! It is right that he was killed! It was just that he was killed! It was I who killed him.” Such thoughts are equivalent to the conscious notion that he wants to kill someone.
Does anyone know of sutras or other ancient sources where the Buddha or Nagarjuna, Shantideva, Chandrakirti, Aryadeva, Buddhapalita, Tsongkhapa or others might have addressed the question of whether karma can be accumulated in dreams and if so, how?
I'm especially interested to know if this question was ever answered or addressed by the Buddha in the pali canon